Tizen appservice 'disposition' attribute added.
authorAndrzej Surdej <a.surdej@samsung.com>
Thu, 21 Feb 2013 10:55:55 +0000 (11:55 +0100)
committerGerrit Code Review <gerrit2@kim11>
Wed, 27 Feb 2013 09:39:11 +0000 (18:39 +0900)
[Issue#] LINUXWRT-58
[Problem] Support for multi activity
[Cause] N/A
[Solution] Attribute parsed and stored into database.
[Verification] To verify build repo with tests and run installer tests.
Last test should pass. Before running tests remove wrt-extra package.

This commit requires: https://tizendev.org/gerrit/#/c/47691/

Also some clean up is done.

Change-Id: I81773b460872d441bcf3cacdaa3b90aedd060dd4

45 files changed:
packaging/wrt-installer.spec
src/configuration_parser/widget_parser.cpp
tests/general/CMakeLists.txt
tests/general/TestCases.cpp
tests/general/widgets/appservice_dispos.wgt [new file with mode: 0644]
tests/general/widgets/content_listener.wgt [deleted file]
tests/general/widgets/content_listener/config.xml [deleted file]
tests/general/widgets/content_listener/hook.js [deleted file]
tests/general/widgets/content_listener/index.html [deleted file]
tests/general/widgets/content_listener/test.html [deleted file]
tests/general/widgets/content_listener2.wgt [deleted file]
tests/general/widgets/content_listener2/config.xml [deleted file]
tests/general/widgets/content_listener2/hook.js [deleted file]
tests/general/widgets/content_listener2/index.html [deleted file]
tests/general/widgets/content_listener2/test.html [deleted file]
tests/general/widgets/minimal.wgt [deleted file]
tests/general/widgets/protocol_listener.wgt [deleted file]
tests/general/widgets/protocol_listener/config.xml [deleted file]
tests/general/widgets/protocol_listener/hook.js [deleted file]
tests/general/widgets/protocol_listener/index.html [deleted file]
tests/general/widgets/protocol_listener/news.html [deleted file]
tests/general/widgets/protocol_listener2.wgt [deleted file]
tests/general/widgets/protocol_listener2/config.xml [deleted file]
tests/general/widgets/protocol_listener2/hook.js [deleted file]
tests/general/widgets/protocol_listener2/index.html [deleted file]
tests/general/widgets/protocol_listener2/news.html [deleted file]
tests/general/widgets/register_content.wgt [deleted file]
tests/general/widgets/register_content/config.xml [deleted file]
tests/general/widgets/register_content/hook.js [deleted file]
tests/general/widgets/register_content/index.html [deleted file]
tests/general/widgets/register_content_fail.wgt [deleted file]
tests/general/widgets/register_content_fail/config.xml [deleted file]
tests/general/widgets/register_content_fail/hook.js [deleted file]
tests/general/widgets/register_content_fail/index.html [deleted file]
tests/general/widgets/register_protocol.wgt [deleted file]
tests/general/widgets/register_protocol/config.xml [deleted file]
tests/general/widgets/register_protocol/hook.js [deleted file]
tests/general/widgets/register_protocol/index.html [deleted file]
tests/general/widgets/register_protocol_fail.wgt [deleted file]
tests/general/widgets/register_protocol_fail/config.xml [deleted file]
tests/general/widgets/register_protocol_fail/hook.js [deleted file]
tests/general/widgets/register_protocol_fail/index.html [deleted file]
tests/general/widgets/tizen_appservice_disposition/config.xml [new file with mode: 0755]
tests/general/widgets/tizen_appservice_disposition/icon.png [new file with mode: 0755]
tests/general/widgets/tizen_appservice_disposition/index.htm [new file with mode: 0755]

index 40c9333..bd2a2ec 100644 (file)
@@ -113,4 +113,5 @@ mkdir -p /opt/share/icons/default/small
 %{_libdir}/systemd/user/wrt-preinstall-widgets.service
 %if %{with_tests}
     %attr(755,root,root) %{_bindir}/wrt-installer-tests-*
+    /opt/share/widget/tests/installer/widgets/*
 %endif
index b1407a0..7703f4b 100644 (file)
@@ -1058,6 +1058,10 @@ class AppServiceParser : public ElementParser
             m_scheme = attribute.value;
         } else if (attribute.name == L"mime") {
             m_mime = attribute.value;
+        } else if (attribute.name == L"disposition") {
+            if (attribute.value == L"inline")
+                m_disposition =
+                    ConfigParserData::ServiceInfo::Disposition::INLINE;
         }
     }
 
@@ -1096,7 +1100,8 @@ class AppServiceParser : public ElementParser
             m_src.IsNull() ? nullString : *m_src,
             m_operation.IsNull() ? nullString : *m_operation,
             m_scheme.IsNull() ? nullString : *m_scheme,
-            m_mime.IsNull() ? nullString : *m_mime);
+            m_mime.IsNull() ? nullString : *m_mime,
+            m_disposition);
 
         FOREACH(iterator, m_data.appServiceList) {
             if (iterator->m_operation == serviceInfo.m_operation &&
@@ -1131,6 +1136,7 @@ class AppServiceParser : public ElementParser
         m_operation(DPL::OptionalString::Null),
         m_scheme(DPL::OptionalString::Null),
         m_mime(DPL::OptionalString::Null),
+        m_disposition(ConfigParserData::ServiceInfo::Disposition::WINDOW),
         m_data(data)
     {}
 
@@ -1139,6 +1145,7 @@ class AppServiceParser : public ElementParser
     DPL::OptionalString m_operation;
     DPL::OptionalString m_scheme;
     DPL::OptionalString m_mime;
+    ConfigParserData::ServiceInfo::Disposition m_disposition;
     ConfigParserData& m_data;
 };
 
index e72a998..9c9bb92 100644 (file)
@@ -26,22 +26,6 @@ PKG_CHECK_MODULES(COMMON_LIB_PKGS
     dpl-utils-efl
     dpl-wrt-dao-ro
     dpl-event-efl
-    glib-2.0
-    gthread-2.0
-    edje
-    ecore
-    ecore-x
-    ecore-imf
-    ecore-ipc
-    ecore-evas
-    ecore-file
-    ecore-input
-    evas
-    eina
-    elementary
-    vconf
-    aul
-    libidn
     xmlsec1
     libiri
     REQUIRED
@@ -78,3 +62,15 @@ target_link_libraries(${INSTALLER_TESTS_TARGET}
   ${TARGET_CORE_MODULE_LIB}
   ${COMMON_LIB_PKGS_LIBRARIES}
 )
+
+#widgets
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/manifest.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/bg-00-with_bg.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/bg-01-missing_file.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/bg-02-without_bg.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/nonroot.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_1.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_2.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_3.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/inst_nplug_4.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/widgets/appservice_dispos.wgt DESTINATION /opt/share/widget/tests/installer/widgets/)
\ No newline at end of file
index a0a978a..32cab9b 100644 (file)
  */
 
 #include <string>
+#include <algorithm>
 #include <dpl/utils/wrt_utility.h>
 #include <dpl/test/test_runner.h>
+#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
 #include <dpl/log/log.h>
 #include <InstallerWrapper.h>
 #include <ManifestFile.h>
@@ -32,7 +34,7 @@ using namespace InstallerWrapper;
 
 namespace {
 
-const std::string miscWidgetsStuff = "/opt/share/widget/tests/misc/";
+const std::string miscWidgetsStuff = "/opt/share/widget/tests/installer/";
 
 struct Result {
     bool m_exc;
@@ -244,3 +246,60 @@ RUNNER_TEST(pluginFileAndSubdir)
         RUNNER_ASSERT_MSG(false, "Invalid widget package installed");
     }
 }
+
+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 ####");
+}
diff --git a/tests/general/widgets/appservice_dispos.wgt b/tests/general/widgets/appservice_dispos.wgt
new file mode 100644 (file)
index 0000000..9451a4f
Binary files /dev/null and b/tests/general/widgets/appservice_dispos.wgt differ
diff --git a/tests/general/widgets/content_listener.wgt b/tests/general/widgets/content_listener.wgt
deleted file mode 100644 (file)
index b2e6fa2..0000000
Binary files a/tests/general/widgets/content_listener.wgt and /dev/null differ
diff --git a/tests/general/widgets/content_listener/config.xml b/tests/general/widgets/content_listener/config.xml
deleted file mode 100644 (file)
index 40d861c..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen = "http://tizen.org/ns/widgets" id="htpp://custom_handlers6">
-  <tizen:application id="listener02" required_version="1.0"/>
-  <name>listener02</name>
-</widget>
-
diff --git a/tests/general/widgets/content_listener/hook.js b/tests/general/widgets/content_listener/hook.js
deleted file mode 100644 (file)
index 959a8b0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-var id = "listener02";
-
-function hook(id, result, message){};
\ No newline at end of file
diff --git a/tests/general/widgets/content_listener/index.html b/tests/general/widgets/content_listener/index.html
deleted file mode 100644 (file)
index 81c7f09..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-    <script type="text/javascript">
-    try {
-        navigator.registerContentHandler("application/test", "test.html?uri=%s", "Example content");
-        if (navigator.isContentHandlerRegistered("application/test", "test.html?uri=%s") === 'registered') {
-            document.getElementById('test').innerHTML = 'PASSED';
-            document.body.style.backgroundColor = 'green';
-            hook(id, 'pass', 'content handler registered');
-        } else {
-            hook(id, 'fail', 'content handler not registered');
-        }
-    } catch (e) {
-        hook(id, 'fail', 'widget failed because ' + e.message);
-    }
-</script>
-</body>
-</html>
diff --git a/tests/general/widgets/content_listener/test.html b/tests/general/widgets/content_listener/test.html
deleted file mode 100644 (file)
index e0a0c10..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-    <script type="text/javascript">
-    try {
-        document.getElementById('test').innerHTML = 'PASSED';
-        document.body.style.backgroundColor = 'green';
-        hook(id, 'pass', 'content handler registered');
-    } catch (e) {
-        hook(id, 'fail', 'widget failed because ' + e.message);
-    }
-</script>
-</body>
-</html>
diff --git a/tests/general/widgets/content_listener2.wgt b/tests/general/widgets/content_listener2.wgt
deleted file mode 100644 (file)
index 99b090c..0000000
Binary files a/tests/general/widgets/content_listener2.wgt and /dev/null differ
diff --git a/tests/general/widgets/content_listener2/config.xml b/tests/general/widgets/content_listener2/config.xml
deleted file mode 100644 (file)
index 6ab4a6b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen = "http://tizen.org/ns/widgets" id="htpp://custom_handlers8">
-  <tizen:application id="listener04" required_version="1.0"/>
-  <name>listener04</name>
-</widget>
-
diff --git a/tests/general/widgets/content_listener2/hook.js b/tests/general/widgets/content_listener2/hook.js
deleted file mode 100644 (file)
index 959a8b0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-var id = "listener02";
-
-function hook(id, result, message){};
\ No newline at end of file
diff --git a/tests/general/widgets/content_listener2/index.html b/tests/general/widgets/content_listener2/index.html
deleted file mode 100644 (file)
index 81c7f09..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-    <script type="text/javascript">
-    try {
-        navigator.registerContentHandler("application/test", "test.html?uri=%s", "Example content");
-        if (navigator.isContentHandlerRegistered("application/test", "test.html?uri=%s") === 'registered') {
-            document.getElementById('test').innerHTML = 'PASSED';
-            document.body.style.backgroundColor = 'green';
-            hook(id, 'pass', 'content handler registered');
-        } else {
-            hook(id, 'fail', 'content handler not registered');
-        }
-    } catch (e) {
-        hook(id, 'fail', 'widget failed because ' + e.message);
-    }
-</script>
-</body>
-</html>
diff --git a/tests/general/widgets/content_listener2/test.html b/tests/general/widgets/content_listener2/test.html
deleted file mode 100644 (file)
index e0a0c10..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-    <script type="text/javascript">
-    try {
-        document.getElementById('test').innerHTML = 'PASSED';
-        document.body.style.backgroundColor = 'green';
-        hook(id, 'pass', 'content handler registered');
-    } catch (e) {
-        hook(id, 'fail', 'widget failed because ' + e.message);
-    }
-</script>
-</body>
-</html>
diff --git a/tests/general/widgets/minimal.wgt b/tests/general/widgets/minimal.wgt
deleted file mode 100644 (file)
index e21996b..0000000
Binary files a/tests/general/widgets/minimal.wgt and /dev/null differ
diff --git a/tests/general/widgets/protocol_listener.wgt b/tests/general/widgets/protocol_listener.wgt
deleted file mode 100644 (file)
index 23d7a21..0000000
Binary files a/tests/general/widgets/protocol_listener.wgt and /dev/null differ
diff --git a/tests/general/widgets/protocol_listener/config.xml b/tests/general/widgets/protocol_listener/config.xml
deleted file mode 100644 (file)
index 0956e53..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen = "http://tizen.org/ns/widgets" id="htpp://custom_handlers5">
-  <tizen:application id="listener01" required_version="1.0"/>
-  <name>listener01</name>
-</widget>
-
diff --git a/tests/general/widgets/protocol_listener/hook.js b/tests/general/widgets/protocol_listener/hook.js
deleted file mode 100644 (file)
index 1300cac..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-var id = "listener01";
-
-function hook(id, result, message){};
\ No newline at end of file
diff --git a/tests/general/widgets/protocol_listener/index.html b/tests/general/widgets/protocol_listener/index.html
deleted file mode 100644 (file)
index f3687d9..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-    <script type="text/javascript">
-    try {
-        navigator.registerProtocolHandler("news", "news.html?uri=%s", "Example news");
-        if (navigator.isProtocolHandlerRegistered("news", "news.html?uri=%s") === 'registered') {
-            document.getElementById('test').innerHTML = 'PASSED';
-            document.body.style.backgroundColor = 'green';
-            hook(id, 'pass', 'protocol handler registered');
-        } else {
-            hook(id, 'fail', 'protocol handler not registered');
-        }
-    } catch (e) {
-        hook(id, 'fail', 'widget failed because ' + e.message);
-    }
-</script>
-</body>
-</html>
diff --git a/tests/general/widgets/protocol_listener/news.html b/tests/general/widgets/protocol_listener/news.html
deleted file mode 100644 (file)
index 5fab155..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-    <script type="text/javascript">
-    try {
-        document.getElementById('test').innerHTML = 'PASSED';
-        document.body.style.backgroundColor = 'green';
-        hook(id, 'pass', 'protocol handler registered');
-    } catch (e) {
-        hook(id, 'fail', 'widget failed because ' + e.message);
-    }
-</script>
-</body>
-</html>
diff --git a/tests/general/widgets/protocol_listener2.wgt b/tests/general/widgets/protocol_listener2.wgt
deleted file mode 100644 (file)
index b828faf..0000000
Binary files a/tests/general/widgets/protocol_listener2.wgt and /dev/null differ
diff --git a/tests/general/widgets/protocol_listener2/config.xml b/tests/general/widgets/protocol_listener2/config.xml
deleted file mode 100644 (file)
index a105a15..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen = "http://tizen.org/ns/widgets" id="htpp://custom_handlers7">
-  <tizen:application id="listener03" required_version="1.0"/>
-  <name>listener03</name>
-</widget>
-
diff --git a/tests/general/widgets/protocol_listener2/hook.js b/tests/general/widgets/protocol_listener2/hook.js
deleted file mode 100644 (file)
index 1300cac..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-var id = "listener01";
-
-function hook(id, result, message){};
\ No newline at end of file
diff --git a/tests/general/widgets/protocol_listener2/index.html b/tests/general/widgets/protocol_listener2/index.html
deleted file mode 100644 (file)
index f3687d9..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-    <script type="text/javascript">
-    try {
-        navigator.registerProtocolHandler("news", "news.html?uri=%s", "Example news");
-        if (navigator.isProtocolHandlerRegistered("news", "news.html?uri=%s") === 'registered') {
-            document.getElementById('test').innerHTML = 'PASSED';
-            document.body.style.backgroundColor = 'green';
-            hook(id, 'pass', 'protocol handler registered');
-        } else {
-            hook(id, 'fail', 'protocol handler not registered');
-        }
-    } catch (e) {
-        hook(id, 'fail', 'widget failed because ' + e.message);
-    }
-</script>
-</body>
-</html>
diff --git a/tests/general/widgets/protocol_listener2/news.html b/tests/general/widgets/protocol_listener2/news.html
deleted file mode 100644 (file)
index 5fab155..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-    <script type="text/javascript">
-    try {
-        document.getElementById('test').innerHTML = 'PASSED';
-        document.body.style.backgroundColor = 'green';
-        hook(id, 'pass', 'protocol handler registered');
-    } catch (e) {
-        hook(id, 'fail', 'widget failed because ' + e.message);
-    }
-</script>
-</body>
-</html>
diff --git a/tests/general/widgets/register_content.wgt b/tests/general/widgets/register_content.wgt
deleted file mode 100644 (file)
index 79cb173..0000000
Binary files a/tests/general/widgets/register_content.wgt and /dev/null differ
diff --git a/tests/general/widgets/register_content/config.xml b/tests/general/widgets/register_content/config.xml
deleted file mode 100644 (file)
index a1f2727..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen = "http://tizen.org/ns/widgets" id="htpp://custom_handlers3">
-  <tizen:application id="register03" required_version="1.0"/>
-  <name>register03</name>
-</widget>
-
diff --git a/tests/general/widgets/register_content/hook.js b/tests/general/widgets/register_content/hook.js
deleted file mode 100644 (file)
index 4866d86..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-var id = "register03";
-
-function hook(id, result, message){};
-
-try {
-    navigator.registerContentHandler("application/test", "?uri=%s", "Example content");
-    if (navigator.isContentHandlerRegistered("application/test", "?uri=%s") === 'registered') {
-        navigator.unregisterContentHandler("application/test", "?uri=%s");
-        if (navigator.isContentHandlerRegistered("application/test", "?uri=%s") === 'new') {
-            document.getElementById('test').innerHTML = 'PASSED';
-            document.body.style.backgroundColor = 'green';
-            hook(id, 'pass', 'content handler registered');
-        } else {
-            hook(id, 'fail', 'content handler registered (tried to unregister)');
-        }
-    } else {
-        hook(id, 'fail', 'content handler not registered');
-    }
-} catch (e) {
-    hook(id, 'fail', 'widget failed because ' + e.message);
-}
\ No newline at end of file
diff --git a/tests/general/widgets/register_content/index.html b/tests/general/widgets/register_content/index.html
deleted file mode 100644 (file)
index 5f572a9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-</body>
-</html>
diff --git a/tests/general/widgets/register_content_fail.wgt b/tests/general/widgets/register_content_fail.wgt
deleted file mode 100644 (file)
index 165c1b2..0000000
Binary files a/tests/general/widgets/register_content_fail.wgt and /dev/null differ
diff --git a/tests/general/widgets/register_content_fail/config.xml b/tests/general/widgets/register_content_fail/config.xml
deleted file mode 100644 (file)
index a037769..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen = "http://tizen.org/ns/widgets" id="htpp://custom_handlers4">
-  <tizen:application id="register04" required_version="1.0"/>
-  <name>register04</name>
-</widget>
-
diff --git a/tests/general/widgets/register_content_fail/hook.js b/tests/general/widgets/register_content_fail/hook.js
deleted file mode 100644 (file)
index ffc4bc6..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-var id = "register04";
-
-function hook(id, result, message){};
-
-try {
-    try {
-        navigator.registerContentHandler("text/html", "?uri=%s", "Example http");
-        throw new Error("Exception not thrown!");
-    } catch (e) {
-        if (!(e instanceof DOMException) || e.code != 18 || e.name != "SECURITY_ERR") {
-            throw e;
-        }
-        document.getElementById('test').innerHTML = 'PASSED';
-        document.body.style.backgroundColor = 'green';
-        hook(id, 'pass', 'content handler not registered');
-    }
-} catch (e) {
-    hook(id, 'fail', 'widget failed because ' + e.message);
-}
\ No newline at end of file
diff --git a/tests/general/widgets/register_content_fail/index.html b/tests/general/widgets/register_content_fail/index.html
deleted file mode 100644 (file)
index 5f572a9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-</body>
-</html>
diff --git a/tests/general/widgets/register_protocol.wgt b/tests/general/widgets/register_protocol.wgt
deleted file mode 100644 (file)
index 36681e1..0000000
Binary files a/tests/general/widgets/register_protocol.wgt and /dev/null differ
diff --git a/tests/general/widgets/register_protocol/config.xml b/tests/general/widgets/register_protocol/config.xml
deleted file mode 100644 (file)
index 4291dfe..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen = "http://tizen.org/ns/widgets" id="htpp://custom_handlers1">
-  <tizen:application id="register01" required_version="1.0"/>
-  <name>register01</name>
-</widget>
-
diff --git a/tests/general/widgets/register_protocol/hook.js b/tests/general/widgets/register_protocol/hook.js
deleted file mode 100644 (file)
index 05fbb46..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-var id = "register01";
-
-function hook(id, result, message){};
-
-try {
-    navigator.registerProtocolHandler("news", "?uri=%s", "Example magnet");
-    if (navigator.isProtocolHandlerRegistered("news", "?uri=%s") === 'registered') {
-        navigator.unregisterProtocolHandler("news", "?uri=%s");
-        if (navigator.isProtocolHandlerRegistered("news", "?uri=%s") === 'new') {
-            document.getElementById('test').innerHTML = 'PASSED';
-            document.body.style.backgroundColor = 'green';
-            hook(id, 'pass', 'protocol handler registered');
-        } else {
-            hook(id, 'fail', 'protocol handler registered (tried to unregister)');
-        }
-    } else {
-        hook(id, 'fail', 'protocol handler not registered');
-    }
-} catch (e) {
-    hook(id, 'fail', 'widget failed because ' + e.message);
-}
\ No newline at end of file
diff --git a/tests/general/widgets/register_protocol/index.html b/tests/general/widgets/register_protocol/index.html
deleted file mode 100644 (file)
index 5f572a9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-</body>
-</html>
diff --git a/tests/general/widgets/register_protocol_fail.wgt b/tests/general/widgets/register_protocol_fail.wgt
deleted file mode 100644 (file)
index 81f651b..0000000
Binary files a/tests/general/widgets/register_protocol_fail.wgt and /dev/null differ
diff --git a/tests/general/widgets/register_protocol_fail/config.xml b/tests/general/widgets/register_protocol_fail/config.xml
deleted file mode 100644 (file)
index 49ebcb7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen = "http://tizen.org/ns/widgets" id="htpp://custom_handlers2">
-  <tizen:application id="register02" required_version="1.0"/>
-  <name>register02</name>
-</widget>
-
diff --git a/tests/general/widgets/register_protocol_fail/hook.js b/tests/general/widgets/register_protocol_fail/hook.js
deleted file mode 100644 (file)
index bc41257..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-var id = "register02";
-
-function hook(id, result, message){};
-
-try {
-    try {
-        navigator.registerProtocolHandler("http", "?uri=%s", "Example http");
-        throw new Error("Exception not thrown!");
-    } catch (e) {
-        if (!(e instanceof DOMException) || e.code != 18 || e.name != "SECURITY_ERR") {
-            throw e;
-        }
-        document.getElementById('test').innerHTML = 'PASSED';
-        document.body.style.backgroundColor = 'green';
-        hook(id, 'pass', 'protocol handler not registered');
-    }
-} catch (e) {
-    hook(id, 'fail', 'widget failed because ' + e.message);
-}
\ No newline at end of file
diff --git a/tests/general/widgets/register_protocol_fail/index.html b/tests/general/widgets/register_protocol_fail/index.html
deleted file mode 100644 (file)
index 5f572a9..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width" />
-  <title>Custom handlers</title>
-</head>
-<body style="background-color:red;">
-    <h1 id="test">FAIL</h1>
-    <script type="text/javascript" src="hook.js"></script>
-</body>
-</html>
diff --git a/tests/general/widgets/tizen_appservice_disposition/config.xml b/tests/general/widgets/tizen_appservice_disposition/config.xml
new file mode 100755 (executable)
index 0000000..4544234
--- /dev/null
@@ -0,0 +1,12 @@
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets"
+    id="http://test.samsung.com/widget/wac/tizen_appservice"
+    version="1.0.0"
+    min-version="1.0">
+  <name short="Disposition">Disposition_attribute</name>
+  <icon src="icon.png" height="75" width="75"/>
+  <tizen:appservice src="edit1.html" operation="http://tizen.org/appsvc/operation/edit" mime="image/jpg" />
+  <tizen:appservice src="edit2.html" operation="http://tizen.org/appsvc/operation/view" mime="audio/ogg" disposition="window"/>
+  <tizen:appservice src="edit3.html" operation="http://tizen.org/appsvc/operation/call" mime="image/png" disposition="inline"/>
+  <tizen:appservice src="edit4.html" operation="http://tizen.org/appsvc/operation/send" mime="text/css" disposition="wrongone"/>
+  <content src="index.html" />
+</widget>
diff --git a/tests/general/widgets/tizen_appservice_disposition/icon.png b/tests/general/widgets/tizen_appservice_disposition/icon.png
new file mode 100755 (executable)
index 0000000..b835ed1
Binary files /dev/null and b/tests/general/widgets/tizen_appservice_disposition/icon.png differ
diff --git a/tests/general/widgets/tizen_appservice_disposition/index.htm b/tests/general/widgets/tizen_appservice_disposition/index.htm
new file mode 100755 (executable)
index 0000000..5e7036c
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+  <head>
+    <title>Disposition attribute</title>
+  </head>
+  <body style="background-color:gray">
+    <h1>Check database.</h1>
+  </body>
+</html>