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/test/test_runner.h>
27 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
28 #include <InstallerWrapper.h>
30 using namespace InstallerWrapper;
32 ////////////////////////////////////////////////////////////////////////////////
34 RUNNER_TEST_GROUP_INIT(ParsingTizenAppservice)
37 Name: correct_csp_policy
38 Description: Tests if widget policy is correctly parsed from config file
39 and stored into database
40 Expected: widget should be installed and policy should mach
42 RUNNER_TEST(tizen_appservice_disposition)
45 RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/appservice_dispos.wgt",
46 tizenId) == InstallerWrapper::Success);
48 WrtDB::WidgetDAOReadOnly dao(DPL::FromASCIIString(tizenId));
49 WidgetApplicationServiceList appsvcList;
50 dao.getAppServiceList(appsvcList);
53 RUNNER_ASSERT_MSG(appsvcList.size() == 4, "Incorrect list size");
54 WidgetApplicationService s;
55 s.src = DPL::FromUTF8String("edit1.html");
56 s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/edit");
57 s.mime = DPL::FromUTF8String("image/jpg"); /* mime type */
58 s.disposition = WidgetApplicationService::Disposition::WINDOW;
60 std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
61 "Unable to find service #");
63 s.src = DPL::FromUTF8String("edit2.html");
64 s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/view");
65 s.mime = DPL::FromUTF8String("audio/ogg"); /* mime type */
66 s.disposition = WidgetApplicationService::Disposition::WINDOW;
68 std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
69 "Unable to find service ##");
71 s.src = DPL::FromUTF8String("edit3.html");
72 s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/call");
73 s.mime = DPL::FromUTF8String("image/png"); /* mime type */
74 s.disposition = WidgetApplicationService::Disposition::INLINE;
76 std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
77 "Unable to find service ###");
79 s.src = DPL::FromUTF8String("edit4.html");
80 s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/send");
81 s.mime = DPL::FromUTF8String("text/css"); /* mime type */
82 s.disposition = WidgetApplicationService::Disposition::WINDOW;
84 std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
85 "Unable to find service ####");