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 Appservice 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(ParsingTizenAppservice)
38 Name: correct_csp_policy
39 Description: Tests if widget policy is correctly parsed from config file
40 and stored into database
41 Expected: widget should be installed and policy should mach
43 RUNNER_TEST(tizen_appservice_disposition)
46 RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/appservice_dispos.wgt",
47 tizenId) == InstallerWrapper::Success);
49 WrtDB::WidgetDAOReadOnly dao(DPL::FromASCIIString(tizenId));
50 WrtDB::WidgetAppControlList appsvcList;
51 dao.getAppControlList(appsvcList);
54 LogDebug("Actual size" << appsvcList.size());
55 RUNNER_ASSERT_MSG(appsvcList.size() == 4, "Incorrect list size");
56 WrtDB::WidgetAppControl s;
57 s.src = DPL::FromUTF8String("edit1.html");
58 s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/edit");
59 s.mime = DPL::FromUTF8String("image/jpg"); /* mime type */
60 s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
62 std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
63 "Unable to find service #");
65 s.src = DPL::FromUTF8String("edit2.html");
66 s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/view");
67 s.mime = DPL::FromUTF8String("audio/ogg"); /* mime type */
68 s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
70 std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
71 "Unable to find service ##");
73 s.src = DPL::FromUTF8String("edit3.html");
74 s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/call");
75 s.mime = DPL::FromUTF8String("image/png"); /* mime type */
76 s.disposition = WrtDB::WidgetAppControl::Disposition::INLINE;
78 std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
79 "Unable to find service ###");
81 s.src = DPL::FromUTF8String("edit4.html");
82 s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/send");
83 s.mime = DPL::FromUTF8String("text/css"); /* mime type */
84 s.disposition = WrtDB::WidgetAppControl::Disposition::WINDOW;
86 std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
87 "Unable to find service ####");