+
+RUNNER_TEST_GROUP_INIT(ParsingTizenAppservice)
+namespace {
+
+}
+
+/*
+Name: correct_csp_policy
+Description: Tests if widget policy is correctly parsed from config file
+ and stored into database
+Expected: widget should be installed and policy should mach
+*/
+RUNNER_TEST(tizen_appservice_disposition)
+{
+ std::string tizenId;
+ RUNNER_ASSERT(install(miscWidgetsStuff + "widgets/appservice_dispos.wgt",
+ tizenId) == InstallerWrapper::Success);
+
+ WrtDB::WidgetDAOReadOnly dao(DPL::FromASCIIString(tizenId));
+ WidgetApplicationServiceList appsvcList;
+ dao.getAppServiceList(appsvcList);
+ uninstall(tizenId);
+
+ RUNNER_ASSERT_MSG(appsvcList.size() == 4, "Incorrect list size");
+ WidgetApplicationService s;
+ s.src = DPL::FromUTF8String("edit1.html");
+ s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/edit");
+ s.mime = DPL::FromUTF8String("image/jpg"); /* mime type */
+ s.disposition = WidgetApplicationService::Disposition::WINDOW;
+ RUNNER_ASSERT_MSG(
+ std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
+ "Unable to find service #");
+
+ s.src = DPL::FromUTF8String("edit2.html");
+ s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/view");
+ s.mime = DPL::FromUTF8String("audio/ogg"); /* mime type */
+ s.disposition = WidgetApplicationService::Disposition::WINDOW;
+ RUNNER_ASSERT_MSG(
+ std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
+ "Unable to find service ##");
+
+ s.src = DPL::FromUTF8String("edit3.html");
+ s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/call");
+ s.mime = DPL::FromUTF8String("image/png"); /* mime type */
+ s.disposition = WidgetApplicationService::Disposition::INLINE;
+ RUNNER_ASSERT_MSG(
+ std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
+ "Unable to find service ###");
+
+ s.src = DPL::FromUTF8String("edit4.html");
+ s.operation = DPL::FromUTF8String("http://tizen.org/appsvc/operation/send");
+ s.mime = DPL::FromUTF8String("text/css"); /* mime type */
+ s.disposition = WidgetApplicationService::Disposition::WINDOW;
+ RUNNER_ASSERT_MSG(
+ std::find(appsvcList.begin(), appsvcList.end(), s) != appsvcList.end(),
+ "Unable to find service ####");
+}