2 * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @author Karol Pawlowski (k.pawlowski@samsung.com)
19 * @author Andrzej Surdej (a.surdej@samsung.com)
21 * @brief Parsing Tizen app-control test's bodies
26 #include <dpl/log/log.h>
27 #include <dpl/test/test_runner.h>
28 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
29 #include <InstallerWrapper.h>
31 using namespace InstallerWrapper;
33 ////////////////////////////////////////////////////////////////////////////////
35 RUNNER_TEST_GROUP_INIT(ParsingTizenAppcontrol)
38 Name: tizen_app-contro
39 Description: Tests if widget app-control tag is correctly parsed
40 Expected: widget should be installed
42 RUNNER_TEST(tizen_app_control)
45 RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/app-control.wgt",
46 tizenId) == InstallerWrapper::Success);
48 WrtDB::WidgetDAOReadOnly dao(DPL::FromASCIIString(tizenId));
49 WrtDB::WidgetAppControlList appcontrolList;
50 dao.getAppControlList(appcontrolList);
53 LogDebug("Actual size" << appcontrolList.size());
54 RUNNER_ASSERT_MSG(appcontrolList.size() == 4, "Incorrect list size");
55 WrtDB::WidgetAppControl s;
56 s.src = DPL::FromUTF8String("edit1.html");
57 s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/edit");
58 s.mime = DPL::FromUTF8String("image/jpg"); /* mime type */
59 s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
62 std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(),
63 "Unable to find service #");
65 s.src = DPL::FromUTF8String("edit2.html");
66 s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/view");
67 s.mime = DPL::FromUTF8String("audio/ogg"); /* mime type */
68 s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
71 std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(),
72 "Unable to find service ##");
74 s.src = DPL::FromUTF8String("edit3.html");
75 s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/call");
76 s.mime = DPL::FromUTF8String("image/png"); /* mime type */
77 s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
80 std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(),
81 "Unable to find service ###");
83 s.src = DPL::FromUTF8String("edit4.html");
84 s.operation = DPL::FromUTF8String("http://tizen.org/appcontrol/operation/send");
85 s.mime = DPL::FromUTF8String("text/css"); /* mime type */
86 s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
89 std::find(appcontrolList.begin(), appcontrolList.end(), s) != appcontrolList.end(),
90 "Unable to find service ####");