[Messageport] - various fixes
authorTomasz Paciorek <t.paciorek@samsung.com>
Tue, 8 Oct 2013 13:39:12 +0000 (15:39 +0200)
committerTomasz Paciorek <t.paciorek@samsung.com>
Tue, 8 Oct 2013 13:39:12 +0000 (15:39 +0200)
Change-Id: Idfdb3a54ccbaca7cc39847291fc4e974f34b7c9d

41 files changed:
tct-messageport-tizen-tests/configure.ac
tct-messageport-tizen-tests/messageport/LocalMessagePort_addMessagePortListener.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_addMessagePortListener_exist.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_addMessagePortListener_listener_TypeMismatch.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_addMessagePortListener_listener_invalid_cb.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_addMessagePortListener_missarg.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_extend.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_isTrusted_attribute.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_messagePortName_attribute.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_notexist.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_removeMessagePortListener.html
tct-messageport-tizen-tests/messageport/LocalMessagePort_removeMessagePortListener_exist.html
tct-messageport-tizen-tests/messageport/Makefile.am
tct-messageport-tizen-tests/messageport/MessagePortCallback_notexist.html
tct-messageport-tizen-tests/messageport/MessagePortCallback_onreceived.html
tct-messageport-tizen-tests/messageport/MessagePortCallback_onreceived_all.html
tct-messageport-tizen-tests/messageport/MessagePortManagerObject_notexist.html
tct-messageport-tizen-tests/messageport/MessagePortManager_extend.html
tct-messageport-tizen-tests/messageport/MessagePortManager_in_tizen.html
tct-messageport-tizen-tests/messageport/MessagePortManager_notexist.html
tct-messageport-tizen-tests/messageport/MessagePortManager_requestLocalMessagePort.html
tct-messageport-tizen-tests/messageport/MessagePortManager_requestLocalMessagePort_exist.html
tct-messageport-tizen-tests/messageport/MessagePortManager_requestRemoteMessagePort.html
tct-messageport-tizen-tests/messageport/MessagePortManager_requestRemoteMessagePort_exist.html
tct-messageport-tizen-tests/messageport/MessagePortManager_requestTrustedLocalMessagePort.html
tct-messageport-tizen-tests/messageport/MessagePortManager_requestTrustedLocalMessagePort_exist.html
tct-messageport-tizen-tests/messageport/MessagePortManager_requestTrustedRemoteMessagePort.html
tct-messageport-tizen-tests/messageport/MessagePortManager_requestTrustedRemoteMessagePort_exist.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_appId_attribute.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_extend.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_isTrusted_attribute.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_messagePortName_attribute.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_notexist.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_sendMessage.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_sendMessage_data_TypeMismatch.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_sendMessage_exist.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_sendMessage_localMessagePort_TypeMismatch.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_sendMessage_missarg.html
tct-messageport-tizen-tests/messageport/RemoteMessagePort_sendMessage_with_localMessagePort.html
tct-messageport-tizen-tests/messageport/support/Makefile.am [new file with mode: 0644]
tct-messageport-tizen-tests/messageport/support/unitcommon.js [new file with mode: 0644]

index 27258941d031b4bd7d0e392c2941d08ce18a11cf..7993dbfd0046cdb1f9614994ac800b9d91497534 100644 (file)
@@ -2,8 +2,7 @@ AC_INIT([tct-messageport-tizen-tests], [2.4.2], [a.krolikowsk@samsung.com])
 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
 
 AC_CONFIG_FILES([Makefile \
-  messageport/Makefile \
-  resources/Makefile \
-  testkit/Makefile \
-])
+messageport/Makefile \
+messageport/support/Makefile \
+resources/Makefile testkit/Makefile])
 AC_OUTPUT
index 4bb647e02b20bd3d187db293ac292be846b20345..f880115ad1685b0fef3245a9e712fef889a3a0e8 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_addMessagePortListener</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -34,12 +34,10 @@ Authors:
 //==== SPEC Tizen Web API:IO:Messageport:LocalMessagePort:addMessagePortListener M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messageport.html
 //==== TEST_CRITERIA MMINA MAST MR
-var t = async_test("LocalMessagePort_addMessagePortListener");
+var t = async_test(document.title), remoteMsgPort, localMsgPort, onReceived, listenerId, messagePortData = [{key: "RESULT",
+    value: "OK"}], app = tizen.application.getCurrentApplication();
 
 t.step(function () {
-    var remoteMsgPort, localMsgPort, onReceived, listenerId,
-        messagePortData = [{key: "RESULT", value: "OK"}],
-        app = tizen.application.getCurrentApplication();
 
     onReceived = t.step_func(function (data) {
         assert_type(data, "array", "MessagePortDataItem should be an array");
index 740993772c2150bcf9f8d8f9c05a085da94039ec..bfede15aaf79b67e104f1ebfcb4937f90d469c30 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_addMessagePortListener_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -39,7 +39,7 @@ test(function () {
 
     assert_true("addMessagePortListener" in localMsgPort, "No addMessagePortListener method in localMsgPort");
     check_method_exists(localMsgPort, "addMessagePortListener");
-}, "LocalMessagePort_addMessagePortListener_exist");
+}, document.title);
 
 </script>
 </body>
index ed90910b0b978282f5e77d7c9fec66fe38945539..95bb02f663991296583ea77f6df62ca45b5b25de 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_addMessagePortListener_listener_TypeMismatch</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -45,12 +45,12 @@ test(function () {
         param = conversionTable[i][0];
         exceptionName = conversionTable[i][1];
 
-        assert_throws({name : exceptionName},
+        assert_throws({name: exceptionName},
             function () {
                 localMsgPort.addMessagePortListener(param);
             }, exceptionName + " should be thrown - given incorrect");
     }
-}, "LocalMessagePort_addMessagePortListener_listener_TypeMismatch");
+}, document.title);
 
 </script>
 </body>
index fc6b5fee3ddfa360c3cfa4096ec478c705f40303..71eea505866ffa4ebd19ac4f3ab45658934a6997 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_addMessagePortListener_listener_invalid_cb</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -35,10 +35,9 @@ Authors:
 //==== SPEC Tizen Web API:IO:Messageport:LocalMessagePort:addMessagePortListener M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messageport.html
 //==== TEST_CRITERIA MTCB
-var t = async_test("LocalMessagePort_addMessagePortListener_listener_invalid_cb");
+var t = async_test(document.title), localMsgPort, incorrectCallback;
 
 t.step(function () {
-    var localMsgPort, incorrectCallback;
 
     localMsgPort = tizen.messageport.requestLocalMessagePort("localMsgPort");
 
@@ -48,7 +47,7 @@ t.step(function () {
         })
     };
 
-    assert_throws({name: "TypeMismatchError"},
+    assert_throws(TYPE_MISMATCH_EXCEPTION,
         function () {
             localMsgPort.addMessagePortListener(incorrectCallback);
         });
index b72cb03799cd774499afbb1b2136557f6575ec53..ea1f24f39c7afb01f168992ce98b98e9a3a0f6f0 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_addMessagePortListener_missarg</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -39,12 +39,12 @@ test(function () {
 
     localMsgPort = tizen.messageport.requestLocalMessagePort("localMsgPort");
 
-    assert_throws({name: "TypeMismatchError"},
+    assert_throws(TYPE_MISMATCH_EXCEPTION,
         function () {
             localMsgPort.addMessagePortListener();
         }, "TypeMismatchError should be thrown");
 
-}, "LocalMessagePort_addMessagePortListener_missarg");
+}, document.title);
 
 </script>
 </body>
index 82d54a9073d2e1242fa93cc0aa32722a56416753..98da3cce3edc1b2713d9cc8a8430a60cce5f1990 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_extend</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -39,7 +39,7 @@ test(function () {
     var localMsgPort = tizen.messageport.requestLocalMessagePort("localMsgPort");
 
     check_extensibility(localMsgPort);
-}, "LocalMessagePort_extend");
+}, document.title);
 
 </script>
 </body>
index a25c8b78ef575612604cdf4758d7638bf559b396..0c3c501f2f46ebaafc2ded68ebd50474221c27e4 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_isTrusted_attribute</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ test(function () {
     var localMsgPort = tizen.messageport.requestLocalMessagePort("localMsgPort");
     assert_own_property(localMsgPort, "isTrusted", "LocalMessagePort does not own isTrusted property");
     check_readonly(localMsgPort, "isTrusted", false, "boolean", true);
-}, "LocalMessagePort_isTrusted_attribute");
+}, document.title);
 
 </script>
 </body>
index e8ed70ab6781aa851034ff865bbbd62975aafc63..c2ebbc2ad7d485bdd1864921991daee82a0bd220 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_messagePortName_attribute</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -40,7 +40,7 @@ test(function () {
     localMsgPort = tizen.messageport.requestLocalMessagePort("localMsgPort");
     assert_own_property(localMsgPort, "messagePortName", "LocalMessagePort does not own messagePortName property");
     check_readonly(localMsgPort, "messagePortName", "localMsgPort", "string", "invalid");
-}, "LocalMessagePort_messagePortName_attribute");
+}, document.title);
 
 </script>
 </body>
index 4682093e322460412fb13fefe2c22d66aa7ab643..dd53cf86f2dc2edded8fd92dcabd99712a633007 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA NIO
 test(function () {
     check_no_interface_object("LocalMessagePort");
-}, "LocalMessagePort_notexist");
+}, document.title);
 
 </script>
 </body>
index e2388be82f4bde6ba0ab983fe703960b829c0406..be8367c1c74e516a88382659b46d984c0eaaced5 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_removeMessagePortListener</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -34,7 +34,7 @@ Authors:
 //==== SPEC Tizen Web API:IO:Messageport:LocalMessagePort:removeMessagePortListener M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messageport.html
 //==== TEST_CRITERIA MMINA MAST MR
-var t = async_test("LocalMessagePort_removeMessagePortListener"), localMsgPort, remoteMsgPort, listenerId, onReceived,
+var t = async_test(document.title), localMsgPort, remoteMsgPort, listenerId, onReceived,
     app = tizen.application.getCurrentApplication(), messagePortData = [{key: "RESULT", value: "OK"}],
     retValue = null;
 
index 9f580a83b90bcd5badd839f78d10cc9c17bdf95c..37e3746d6c0af2fc8bc9871e8eee048b523f417b 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>LocalMessagePort_removeMessagePortListener_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -41,7 +41,7 @@ test(function () {
 
     assert_true("removeMessagePortListener" in localMsgPort, "No removeMessagePortListener method in localMsgPort");
     check_method_exists(localMsgPort, "removeMessagePortListener");
-}, "LocalMessagePort_removeMessagePortListener_exist");
+}, document.title);
 
 </script>
 </body>
index b93c2f3307c796173e3c3c36b699b0fb8135e8ef..a6a716979a64f29ea9a1fa9e6617c0a8e67e0470 100644 (file)
@@ -1,3 +1,4 @@
-worker_DATA = *
+SUBDIRS = support
+worker_DATA = *.html
 workerdir = /opt/tct-messageport-tizen-tests/messageport
 EXTRA_DIST = $(worker_DATA)
index 75d02e4c1c04664d8b7e423a8f25ff502d129fa8..487a0f5805ec337871ae5797b73e416c27017113 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortCallback_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA CBNIO
 test(function () {
     check_no_interface_object("MessagePortCallback");
-}, "MessagePortCallback_notexist");
+}, document.title);
 
 </script>
 </body>
index 513bc1860750588990c5ad58ab1a4e52e1bdec0a..60d6d5a9066a7b17d8f090487ac4b870896315e3 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortCallback_onreceived</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -34,12 +34,10 @@ Authors:
 //==== SPEC Tizen Web API:IO:Messageport:MessagePortCallback:onreceived M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messageport.html
 //==== TEST_CRITERIA CBT CBOA
-var t = async_test("MessagePortCallback_onreceived");
+var t = async_test(document.title), remoteMsgPort, localMsgPort, onReceived, listenerId, messagePortData = [{key: "RESULT",
+    value: "OK"}], app = tizen.application.getCurrentApplication();
 
 t.step(function () {
-    var remoteMsgPort, localMsgPort, onReceived, listenerId,
-        messagePortData = [{key: "RESULT", value: "OK"}],
-        app = tizen.application.getCurrentApplication();
 
     onReceived = t.step_func(function (data) {
         assert_type(data, "array", "Argument data has an invalid type");
index bdb4a7606b582da8b6923fc5fffe88ee00db1918..9358501f6615302d8dc98728a5d6c04bd11881a2 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortCallback_onreceived_all</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -34,12 +34,10 @@ Authors:
 //==== SPEC Tizen Web API:IO:Messageport:MessagePortCallback:onreceived M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messageport.html
 //==== TEST_CRITERIA CBOA
-var t = async_test("MessagePortCallback_onreceived_all");
+var t = async_test(document.title), remoteMsgPort, localMsgPort, onReceived, listenerId, messagePortData = [{key: "RESULT",
+    value: "OK"}], app = tizen.application.getCurrentApplication();
 
 t.step(function () {
-    var remoteMsgPort, localMsgPort, onReceived, listenerId,
-        messagePortData = [{key: "RESULT", value: "OK"}],
-        app = tizen.application.getCurrentApplication();
 
     onReceived = t.step_func(function (data, remoteMessagePort) {
         assert_equals(data.key, messagePortData.key, "Received data should be the same");
index cd66bd0616257ff91c54745248b27e1d10d83e76..f81f11d4d1ef625c9baab3ecae6901ca2d816d04 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManagerObject_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA NIO
 test(function () {
     check_no_interface_object("MessagePortManagerObject");
-}, "MessagePortManagerObject_notexist");
+}, document.title);
 
 </script>
 </body>
index 9e52e8b073cd2f92e93c1a9501b767b773211282..4a4366ca5e28e155c3074c0600bae430dcc0b14d 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_extend</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA OBX
 test(function () {
     check_extensibility(tizen.messageport);
-}, "MessagePortManager_extend");
+}, document.title);
 
 </script>
 </body>
index ec17e69fc1cac15e4bd790506985255ba36befda..abb0506866463a493482e781b7aa483f197bde5e 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_in_tizen</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -38,7 +38,7 @@ Authors:
 test(function () {
     assert_true("messageport" in tizen, "No messageport in tizen");
     check_readonly(tizen, "messageport", tizen.messageport, "object", "dummyValue");
-}, "MessagePortManager_in_tizen");
+}, document.title);
 
 </script>
 </body>
index 6bc00ba6c344f74eba7813339b4770ef82f5e0c4..76c13b9f283c22aa250485fc3a3282a4bb66ba53 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA NIO
 test(function () {
     check_no_interface_object("MessagePortManager");
-}, "MessagePortManager_notexist");
+}, document.title);
 
 </script>
 </body>
index 068bf889ea1e2de8084db95b5d71733ab7fe175f..5c6d13610102a5e21eb4411ce4fb5c5903497910 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_requestLocalMessagePort</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -41,7 +41,7 @@ test(function () {
 
     assert_equals(localMsgPort.messagePortName, "localMsgPort", "localMsgPort should have proper name");
     assert_equals(localMsgPort.isTrusted, false, "isTrusted property should be false");
-}, "MessagePortManager_requestLocalMessagePort");
+}, document.title);
 
 </script>
 </body>
index eda86b13e67f85b0d5a8ebb9c7fbf700b920e788..b5c57cd569717a1858595548ba5e3817e201718e 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_requestLocalMessagePort_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 test(function () {
     assert_true("requestLocalMessagePort" in tizen.messageport, "No requestLocalMessagePort method in tizen.messageport");
     check_method_exists(tizen.messageport, "requestLocalMessagePort");
-}, "MessagePortManager_requestLocalMessagePort_exist");
+}, document.title);
 
 </script>
 </body>
index f436ab47ff2bc56db89459d7abd024bde2c32bc7..dc0cfffb062a71a199baeeb02d30cb1df8b55e98 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_requestRemoteMessagePort</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -44,7 +44,7 @@ test(function () {
     assert_equals(remoteMsgPort.messagePortName, "remoteMsgPort", "remoteMsgPort should have proper name");
     assert_equals(remoteMsgPort.appId, app.appInfo.id, "ids should be equal");
     assert_equals(remoteMsgPort.isTrusted, false, "isTrusted property should be false");
-}, "MessagePortManager_requestRemoteMessagePort");
+}, document.title);
 
 </script>
 </body>
index a126037537433c55ae7278719632c46300025bdc..2ee254756f06f48201ca5d02aeebb80d5ee5fcf0 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_requestRemoteMessagePort_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 test(function () {
     assert_true("requestRemoteMessagePort" in tizen.messageport, "No requestRemoteMessagePort method in tizen.messageport");
     check_method_exists(tizen.messageport, "requestRemoteMessagePort");
-}, "MessagePortManager_requestRemoteMessagePort_exist");
+}, document.title);
 
 </script>
 </body>
index 5389705c03b9e67f33dc232a964c49145d5f697e..f1cb85e8be9f58af1d10e4c4b23587a9cbe1549c 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_requestTrustedLocalMessagePort</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -41,7 +41,7 @@ test(function () {
 
     assert_equals(trustedLocalMsgPort.messagePortName, "trustedLocalMsgPort", "trustedLocalMsgPort should have proper name");
     assert_equals(trustedLocalMsgPort.isTrusted, true, "trustedLocalMsgPort should be trusted");
-}, "MessagePortManager_requestTrustedLocalMessagePort");
+}, document.title);
 
 </script>
 </body>
index 809de6ef7e7daebe93851f0d6afdce65c0acd802..8cc2bbc9a7573802b1962a6174f2b76f61b2d956 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_requestTrustedLocalMessagePort_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 test(function () {
     assert_true("requestTrustedLocalMessagePort" in tizen.messageport, "No requestTrustedLocalMessagePort method in tizen.messageport");
     check_method_exists(tizen.messageport, "requestTrustedLocalMessagePort");
-}, "MessagePortManager_requestTrustedLocalMessagePort_exist");
+}, document.title);
 
 </script>
 </body>
index 38eac63203e25925995fed5c0379c0b0094d0a2e..ffba478853af71d85007236e8ac76637b132d112 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_requestTrustedRemoteMessagePort</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -44,7 +44,7 @@ test(function () {
     assert_equals(trustedRemoteMsgPort.messagePortName, "remoteMsgPort", "trustedRemoteMsgPort should have proper name");
     assert_equals(trustedRemoteMsgPort.appId, app.appInfo.id, "ids should be equal");
     assert_equals(trustedRemoteMsgPort.isTrusted, true, "trustedRemoteMsgPort should be trusted");
-}, "MessagePortManager_requestTrustedRemoteMessagePort");
+}, document.title);
 
 </script>
 </body>
index 5dfd1df698013aafbdbd63bae7d74c36944b036d..24a9875ef6b196cf7394f1126775c86b8331de08 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>MessagePortManager_requestTrustedRemoteMessagePort_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 test(function () {
     assert_true("requestTrustedRemoteMessagePort" in tizen.messageport, "No requestTrustedRemoteMessagePort method in tizen.messageport");
     check_method_exists(tizen.messageport, "requestTrustedRemoteMessagePort");
-}, "MessagePortManager_requestTrustedRemoteMessagePort_exist");
+}, document.title);
 
 </script>
 </body>
index 86448e618a6041bfeae43ece7e9fa963f2444be9..a8560e2e34bde85bac5ff42863e9c01032f13329 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_appId_attribute</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -42,7 +42,7 @@ test(function () {
     remoteMsgPort = tizen.messageport.requestRemoteMessagePort(app.appInfo.id, "remoteMsgPort");
     assert_own_property(remoteMsgPort, "appId", "RemoteMessagePort does not own appId property");
     check_readonly(remoteMsgPort, "appId", app.appInfo.id, "string", "invalid");
-}, "RemoteMessagePort_appId_attribute");
+}, document.title);
 
 </script>
 </body>
index 426177354af0e8db838e773fe3fd833b1648d1c2..5a0252b96cdc368c33b208b9a7126b1d6c66e663 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_extend</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -43,7 +43,7 @@ test(function () {
     remoteMsgPort = tizen.messageport.requestRemoteMessagePort(app.appInfo.id, "remoteMsgPort");
 
     check_extensibility(remoteMsgPort);
-}, "RemoteMessagePort_extend");
+}, document.title);
 
 </script>
 </body>
index e43b228f46bc1b49554599434d3e6b1bd9fe1fbd..a68165563fa4e173fa2acd89d8ae2271ecac54f2 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_isTrusted_attribute</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -42,7 +42,7 @@ test(function () {
     remoteMsgPort = tizen.messageport.requestRemoteMessagePort(app.appInfo.id, "remoteMsgPort");
     assert_own_property(remoteMsgPort, "isTrusted", "RemoteMessagePort does not own isTrusted property");
     check_readonly(remoteMsgPort, "isTrusted", false, "boolean", true);
-}, "RemoteMessagePort_isTrusted_attribute");
+}, document.title);
 
 </script>
 </body>
index 23d98dab5050b9fd1a75798c412bf91ee329618e..a40858cc1b1dbaa4cc5a1146e50014f730c72465 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_messagePortName_attribute</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -42,7 +42,7 @@ test(function () {
     remoteMsgPort = tizen.messageport.requestRemoteMessagePort(app.appInfo.id, "remoteMsgPort");
     assert_own_property(remoteMsgPort, "messagePortName", "RemoteMessagePort does not own messagePortName property");
     check_readonly(remoteMsgPort, "messagePortName", "remoteMsgPort", "string", "invalid");
-}, "RemoteMessagePort_messagePortName_attribute");
+}, document.title);
 
 </script>
 </body>
index e9b4edb1f0874013b64bd566ccbec03483d40a9a..814dc31a9e87835b5ec732d0bc67d2175bf24ef6 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_notexist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA NIO
 test(function () {
     check_no_interface_object("RemoteMessagePort");
-}, "RemoteMessagePort_notexist");
+}, document.title);
 
 </script>
 </body>
index 8eba66387fe17ca82bb86afbadfbfe074b0d9ba8..e7cb2cdcfdfb2219c4ce608756eaa578efb92652 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_sendMessage</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -34,12 +34,10 @@ Authors:
 //==== SPEC Tizen Web API:IO:Messageport:RemoteMessagePort:sendMessage M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messageport.html
 //==== TEST_CRITERIA MMINA MR
-var t = async_test("RemoteMessagePort_sendMessage"), retValue = null;
+var t = async_test(document.title), retValue = null, remoteMsgPort, localMsgPort, onReceived, listenerId, messagePortData = [{key: "RESULT",
+    value: "OK"}], app = tizen.application.getCurrentApplication();
 
 t.step(function () {
-    var remoteMsgPort, localMsgPort, onReceived, listenerId,
-        messagePortData = [{key: "RESULT", value: "OK"}],
-        app = tizen.application.getCurrentApplication();
 
     onReceived = t.step_func(function (data) {
         assert_equals(retValue, undefined, "sendMessage returns wrong value");
index 91164c2408dd9ef5b659f9ceee184575a63fbd5c..ac59aaceea3f0e5a6f1849fc2f9814ef20ffe02e 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_sendMessage_data_TypeMismatch</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -47,12 +47,12 @@ test(function () {
         param = conversionTable[i][0];
         exceptionName = conversionTable[i][1];
 
-        assert_throws({name : exceptionName},
+        assert_throws({name: exceptionName},
             function () {
                 remoteMsgPort.sendMessage(param);
             }, exceptionName + " should be thrown - given incorrect");
     }
-}, "RemoteMessagePort_sendMessage_data_TypeMismatch");
+}, document.title);
 
 </script>
 </body>
index 9015d8d1ff8782631faca2e66904201c1e70df2e..4a4e6988106dc8179ff5fdb527c887fc2d387448 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_sendMessage_exist</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -43,7 +43,7 @@ test(function () {
 
     assert_true("sendMessage" in remoteMsgPort, "No sendMessage method in RemoteMessagePort");
     check_method_exists(remoteMsgPort, "sendMessage");
-}, "RemoteMessagePort_sendMessage_exist");
+}, document.title);
 
 </script>
 </body>
index 8b53e8ecaaf1cedc72ec0ab3f040d578ac914689..6a19379e365475a0e1d24a53a7313684a61742fd 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_sendMessage_localMessagePort_TypeMismatch</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -37,7 +37,7 @@ Authors:
 //==== TEST_CRITERIA MC
 test(function () {
     var remoteMsgPort, localMsgPort, conversionTable, param, exceptionName, i,
-        messagePortData = [{key:"RESULT",value:"OK"}],
+        messagePortData = [{key:"RESULT", value:"OK"}],
         app = tizen.application.getCurrentApplication();
 
     localMsgPort = tizen.messageport.requestLocalMessagePort("remoteMsgPort");
@@ -48,12 +48,12 @@ test(function () {
         param = conversionTable[i][0];
         exceptionName = conversionTable[i][1];
 
-        assert_throws({name : exceptionName},
+        assert_throws({name: exceptionName},
             function () {
                 remoteMsgPort.sendMessage(messagePortData, param);
             }, exceptionName + " should be thrown - given incorrect");
     }
-}, "RemoteMessagePort_sendMessage_localMessagePort_TypeMismatch");
+}, document.title);
 
 </script>
 </body>
index 1d7f1cd8599c0866852a1692f00e83674112eb0f..fd1696f5420c9cd9951e148bec68305b240faa44 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_sendMessage_missarg</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -41,12 +41,12 @@ test(function () {
     localMsgPort = tizen.messageport.requestLocalMessagePort("remoteMsgPort");
     remoteMsgPort = tizen.messageport.requestRemoteMessagePort(app.appInfo.id, "remoteMsgPort");
 
-    assert_throws({name: "TypeMismatchError"},
+    assert_throws(TYPE_MISMATCH_EXCEPTION,
         function () {
             remoteMsgPort.sendMessage();
         }, "TypeMismatchError should be thrown");
 
-}, "RemoteMessagePort_sendMessage_missarg");
+}, document.title);
 
 </script>
 </body>
index 002d284e71f4441d0bd4567f560259e82f0cddd1..86d1907c345602c8f5d08e72ae611ce6d0d241c2 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>RemoteMessagePort_sendMessage_with_localMessagePort</title>
 <meta charset="utf-8"/>
-<script type="text/javascript" src="../resources/unitcommon.js"></script>
+<script type="text/javascript" src="support/unitcommon.js"></script>
 </head>
 
 <body>
@@ -34,12 +34,10 @@ Authors:
 //==== SPEC Tizen Web API:IO:Messageport:RemoteMessagePort:sendMessage M
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/messageport.html
 //==== TEST_CRITERIA MOA MAST
-var t = async_test("RemoteMessagePort_sendMessage_with_localMessagePort");
+var t = async_test(document.title), remoteMsgPort, localMsgPort, onReceived, listenerId, messagePortData = [{key: "RESULT",
+    value: "OK"}], app = tizen.application.getCurrentApplication();
 
 t.step(function () {
-    var remoteMsgPort, localMsgPort, onReceived, listenerId,
-        messagePortData = [{key: "RESULT", value: "OK"}],
-        app = tizen.application.getCurrentApplication();
 
     onReceived = t.step_func(function (data, remoteMessagePort) {
         assert_type(data, "array", "MessagePortDataItem should be an array");
diff --git a/tct-messageport-tizen-tests/messageport/support/Makefile.am b/tct-messageport-tizen-tests/messageport/support/Makefile.am
new file mode 100644 (file)
index 0000000..904ea06
--- /dev/null
@@ -0,0 +1,3 @@
+supportdir = /opt/tct-messageport-tizen-tests/messageport/support
+support_DATA = *.js
+EXTRA_DIST = $(support_DATA)
diff --git a/tct-messageport-tizen-tests/messageport/support/unitcommon.js b/tct-messageport-tizen-tests/messageport/support/unitcommon.js
new file mode 100644 (file)
index 0000000..9f972c1
--- /dev/null
@@ -0,0 +1,559 @@
+/*
+
+Copyright (c) 2013 Samsung Electronics Co., Ltd.
+
+Licensed under the Apache License, Version 2.0 (the License);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+
+Authors:
+
+ */
+
+
+MIN_BYTE = -128;
+MAX_BYTE = 127;
+MIN_OCTET = 0;
+MAX_OCTET = 255;
+MIN_SHORT = -32768;
+MAX_SHORT = 32767;
+MIN_UNSIGNED_SHORT = 0;
+MAX_UNSIGNED_SHORT = 65535;
+MIN_LONG = -2147483648;
+MAX_LONG = 2147483647;
+MIN_UNSIGNED_LONG = 0;
+MAX_UNSIGNED_LONG = 4294967295;
+MIN_LONG_LONG = -9223372036854775808;
+MAX_LONG_LONG = 9223372036854775807;
+MIN_UNSIGNED_LONG_LONG = 0;
+MAX_UNSIGNED_LONG_LONG = 18446744073709551615;
+
+TYPE_MISMATCH_EXCEPTION = {name: 'TypeMismatchError'};
+NOT_FOUND_EXCEPTION = {name: 'NotFoundError'};
+INVALID_VALUES_EXCEPTION = {name: 'InvalidValuesError'};
+IO_EXCEPTION = {name: 'IOError'};
+SECURITY_EXCEPTION = {name: 'SecurityError'};
+
+
+(function () {
+   var head_src = document.head.innerHTML;
+   if (head_src.search(/\/testharness.js\W/) === -1) {
+       document.write('<script language="javascript" src="../resources/testharness.js"></script>\n');
+   }
+   if (head_src.search(/\/testharnessreport.js\W/) === -1) {
+       document.write('<script language="javascript" src="../resources/testharnessreport.js"></script>\n');
+   }
+})();
+
+var _registered_types = {};
+
+function _resolve_registered_type(type) {
+    while (type in _registered_types) {
+        type = _registered_types[type];
+    }
+    return type;
+}
+
+/**
+ * Method checks extra argument for none argument method.
+ * The only check is that method will not throw an exception.
+ * Example usage:
+ * checkExtraArgument(tizen.notification, "removeAll");
+ *
+ * @param object object
+ * @param methodName string - name of the method
+ */
+function checkExtraArgument(object, methodName) {
+    var extraArgument = [
+        null,
+        undefined,
+        "Tizen",
+        1,
+        false,
+        ["one", "two"],
+        {argument: 1},
+        function () {}
+    ], i;
+
+    for (i = 0; i < extraArgument.length; i++) {
+        object[methodName](extraArgument[i]);
+    }
+}
+
+/**
+ * Method to validate conversion.
+ * Example usage:
+ *   conversionTable = getTypeConversionExceptions("functionObject", true);
+ *   for(i = 0; i < conversionTable.length; i++) {
+ *       errorCallback = conversionTable[i][0];
+ *       exceptionName = conversionTable[i][1];
+ *
+ *       assert_throws({name : exceptionName},
+ *       function () {
+ *           tizen.systemsetting.setProperty("HOME_SCREEN",
+ *               propertyValue, successCallback, errorCallback);
+ *       }, exceptionName + " should be thrown - given incorrect errorCallback.");
+ *   }
+ *
+ * @param conversionType
+ * @param isOptional
+ * @returns table of tables which contain value (index 0) and exceptionName (index 1)
+ *
+ */
+function getTypeConversionExceptions(conversionType, isOptional) {
+    var exceptionName = "TypeMismatchError",
+        conversionTable;
+    switch (conversionType) {
+        case "enum":
+            conversionTable = [
+                [undefined, exceptionName],
+                [null, exceptionName],
+                [0, exceptionName],
+                [true, exceptionName],
+                ["dummyInvalidEnumValue", exceptionName],
+                [{ }, exceptionName]
+            ];
+            break;
+        case "double":
+            conversionTable = [
+                [undefined, exceptionName],
+                [NaN, exceptionName],
+                [Number.POSITIVE_INFINITY, exceptionName],
+                [Number.NEGATIVE_INFINITY, exceptionName],
+                ["TIZEN", exceptionName],
+                [{ name : "TIZEN" }, exceptionName],
+                [function () { }, exceptionName]
+            ];
+            break;
+        case "object":
+            conversionTable = [
+                [true, exceptionName],
+                [false, exceptionName],
+                [NaN, exceptionName],
+                [0, exceptionName],
+                ["", exceptionName],
+                ["TIZEN", exceptionName],
+                [undefined, exceptionName]
+            ];
+            if (!isOptional) {
+                conversionTable.push([null, exceptionName]);
+            }
+            break;
+        case "functionObject":
+            conversionTable = [
+                [true, exceptionName],
+                [false, exceptionName],
+                [NaN, exceptionName],
+                [0, exceptionName],
+                ["", exceptionName],
+                ["TIZEN", exceptionName],
+                [[], exceptionName],
+                [{ }, exceptionName],
+                [undefined, exceptionName]
+            ];
+            if (!isOptional) {
+                conversionTable.push([null, exceptionName]);
+            }
+            break;
+        case "array":
+            conversionTable = [
+                [true, exceptionName],
+                [false, exceptionName],
+                [NaN, exceptionName],
+                [0, exceptionName],
+                ["", exceptionName],
+                ["TIZEN", exceptionName],
+                [{ }, exceptionName],
+                [function () { }, exceptionName],
+                [undefined, exceptionName]
+            ];
+            if (!isOptional) {
+                conversionTable.push([null, exceptionName]);
+            }
+            break;
+        case "dictionary":
+            conversionTable = [
+                [true, exceptionName],
+                [false, exceptionName],
+                [NaN, exceptionName],
+                [0, exceptionName],
+                ["", exceptionName],
+                ["TIZEN", exceptionName],
+                [undefined, exceptionName]
+            ];
+            if (!isOptional) {
+                conversionTable.push([null, exceptionName]);
+            }
+            break;
+        default:
+            assert_unreached("Fix your test. Wrong conversionType '" + conversionType + "'.");
+    };
+
+    return conversionTable;
+}
+
+
+function assert_type(obj, type, description) {
+    var org_type = type, prop_name, prop_type, prop_value;
+
+    type = _resolve_registered_type(type);
+
+    if (typeof (type) === 'string') {
+        type = type.toLowerCase();
+        switch (type) {
+            case 'object':
+            case 'string':
+            case 'number':
+            case 'function':
+            case 'boolean':
+            case 'undefined':
+            case 'xml':
+                assert_equals(typeof (obj), type, description);
+                break;
+            case 'null':
+                assert_true(obj === null, description);
+                break;
+            case 'array':
+                assert_true(Array.isArray(obj), description);
+                break;
+            case 'date':
+                assert_true(obj instanceof Date, description);
+                break;
+            case 'byte':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_BYTE, description + " - value too high.");
+                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+                break;
+            case 'octet':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_OCTET, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_OCTET, description + " - value too high.");
+                assert_equals(obj % 1, 0, description + " - value is not an integer.");
+                break;
+            case 'short':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_SHORT, description + " - value too high.");
+                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+                break;
+            case 'unsigned short':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_UNSIGNED_SHORT, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_UNSIGNED_SHORT, description + " - value too high.");
+                assert_equals(obj % 1, 0, description + " - value is not an integer.");
+                break;
+            case 'long':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_LONG, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_LONG, description + " - value too high.");
+                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+                break;
+            case 'unsigned long':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_UNSIGNED_LONG, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_UNSIGNED_LONG, description + " - value too high.");
+                assert_equals(obj % 1, 0, description + " - value is not an integer.");
+                break;
+            case 'long long':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high.");
+                assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer.");
+                break;
+            case 'unsigned long long':
+                assert_equals(typeof (obj), 'number', description);
+                assert_greater_than_equal(obj, MIN_UNSIGNED_LONG_LONG, description + " - value too low.");
+                assert_less_than_equal(obj, MAX_UNSIGNED_LONG_LONG, description + " - value too high.");
+                assert_equals(obj % 1, 0, description + " - value is not an integer.");
+                break;
+            default:
+                assert_unreached('Fix your test. Wrong type \'' + org_type + '\'');
+        }
+    } else if (typeof (type) === 'function') {
+        assert_true(obj instanceof type, description);
+    } else if (typeof (type) === 'object') {
+        for (prop_name in type) {
+            prop_type = type[prop_name];
+            if (prop_type === 'function') {
+                assert_inherits(obj, prop_name);
+                assert_equals(typeof obj[prop_name], prop_type, 'Object should have method ' + prop_name);
+            } else {
+                assert_own_property(obj, prop_name);
+            }
+        }
+    } else {
+        assert_unreached('Fix your test. Wrong type ' + org_type);
+    }
+}
+
+function register_type(alias, type_spec) {
+    _registered_types[alias] = type_spec;
+}
+
+/**
+ * Method to check if attribute is const.
+ * Example usage:
+ * check_const(tizen.bluetooth.deviceMinor, 'TOY_DOLL', 0x03, 'number', 0x29B);
+ *
+ * @param obj  object to test which  has const attribute
+ * @param attributeName attribute name.
+ * @param expectedValue expected value of provided attribute name
+ * @param expectedType expected type of provided attribute name
+ * @param valueToAssign value to assign in order to check if attribute value can be modified
+ */
+function check_const(obj, attributeName, expectedValue, expectedType, valueToAssign) {
+    var tmp;
+    if (expectedValue === valueToAssign) {
+        assert_unreached("Fix your test. The same values given for "  + attributeName +
+            " in 'value' and 'valueToSet' arguments.");
+    }
+    if (typeof (attributeName) === "string") {
+        assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
+        assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
+        if (typeof (expectedType) !== "undefined") {
+            if (expectedValue === null) {
+                assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
+            } else {
+                assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
+            }
+        } else {
+            assert_unreached("Fix your test. Wrong type " + expectedType);
+        }
+        tmp = obj[attributeName];
+        obj[attributeName] = valueToAssign;
+        assert_equals(obj[attributeName], tmp, attributeName + " can be modified.");
+    } else {
+        assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
+    }
+}
+
+/**
+ * Method to check if attribute is readonly.
+ * Example usage:
+ * check_readonly(statusNotification, "postedTime", null, 'object', new Date());
+ *
+ * @param obj  object to test which  has readonly attribute
+ * @param attributeName attribute name.
+ * @param expectedValue expected value of provided attribute name
+ * @param expectedType expected type of provided attribute name
+ * @param valueToAssign value to assign in order to check if attribute value can be modified
+ */
+function check_readonly(obj, attributeName, expectedValue, expectedType, valueToAssign) {
+    check_const(obj, attributeName, expectedValue, expectedType, valueToAssign);
+}
+
+/**
+ * Method to check if attribute can be set to null.
+ * Example usage:
+ * check_not_nullable(syncInfo, "mode");
+ *
+ * @param obj object to test which has not nullable attribute
+ * @param attributeName attribute name.
+ */
+function check_not_nullable(obj, attributeName)
+{   var old_value = obj[attributeName];
+    obj[attributeName] = null;
+    assert_not_equals(obj[attributeName], null, "Attribute " + attributeName + " can be set to null.");
+    obj[attributeName] = old_value;
+}
+
+/**
+ * Method to check NoInterfaceObject
+ * Example usage:
+ * check_no_interface_object("BluetoothAdapter")
+ *
+ * @param interfaceName interface name
+ */
+function check_no_interface_object(interfaceName) {
+    assert_throws({name: "TypeError"}, function () {
+        tizen[interfaceName]();
+    },"Wrong call as a function");
+    assert_throws({name: "TypeError"}, function () {
+        new tizen[interfaceName]();
+    },"Wrong call as a new function");
+    assert_throws({name: "TypeError"}, function () {
+        ({}) instanceof tizen[interfaceName];
+    },"instanceof exception");
+    assert_equals(tizen[interfaceName], undefined, interfaceName + " is not undefined.");
+}
+
+
+/**
+ * Method to check Constructors
+ * Example usage:
+ * check_constructor("BluetoothAdapter")
+ *
+ * @param constructorName constructor name
+ */
+
+function check_constructor(constructorName) {
+    assert_true(constructorName in tizen, "No " + constructorName + " in tizen.");
+    assert_false({} instanceof tizen[constructorName],"Custom object is not instance of " + constructorName);
+    assert_throws({
+        name: "TypeError"
+    }, function () {
+        tizen[constructorName]();
+    }, "Constructor called as function.");
+}
+
+/**
+ * Method to check if given method can be overridden in a given object - (TEMPORARY REMOVED).
+ * That method also checks if given method exists in a given object.
+ * Example usage:
+ * check_method_exists(tizen.notification, "get");
+ *
+ * @param obj object with method
+ * @param methodName name of the method to check.
+ */
+function check_method_exists(obj, methodName) {
+    assert_type(obj[methodName], 'function', "Method does not exist.");
+}
+
+/**
+ * Method to check extensibility of given object.
+ * Method checks if new attribute and method can be added.
+ * Example usage:
+ * check_extensibility(tizen.notification);
+ *
+ * @param obj object to check
+ */
+function check_extensibility(obj) {
+    var dummyAttribute = "dummyAttributeValue", dummyMethodResult = "dummyMethodResultValue";
+    obj.newDummyMethod = function() {
+        return dummyMethodResult;
+    }
+    assert_equals(obj.newDummyMethod(), dummyMethodResult, "Incorrect result from added method.");
+
+    obj.newDummyAttribute = dummyAttribute;
+    assert_equals(obj.newDummyAttribute, dummyAttribute, "Incorrect result from added attribute.");
+}
+
+/**
+ * Method to check if attribute can be modify.
+ * Example usage:
+ * check_attr(downloadRequest, "fileName", default_val, "string", "file_name.html");
+ *
+ * @param obj  object to test which has not readonly attribute
+ * @param attributeName attribute name.
+ * @param expectedValue expected value of provided attribute name
+ * @param expectedType expected type of provided attribute name
+ * @param valueToAssign value to assign in order to check if attribute value can be modified
+ */
+function check_attribute(obj, attributeName, expectedValue, expectedType, valueToAssign) {
+    if (expectedValue === valueToAssign) {
+        assert_unreached("Fix your test. The same values given for "  + attributeName +
+            " in 'value' and 'valueToSet' arguments.");
+    }
+    if (typeof (attributeName) === "string") {
+        assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object.");
+        assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent.");
+        if (typeof (expectedType) !== "undefined") {
+            if (expectedValue === null) {
+                assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different.");
+            } else {
+                assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different.");
+            }
+        } else {
+            assert_unreached("Fix your test. Wrong type " + expectedType);
+        }
+        obj[attributeName] = valueToAssign;
+        assert_equals(obj[attributeName], valueToAssign, attributeName + " can be modified.");
+    } else {
+        assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName));
+    }
+}
+
+/**
+ * Method to check if whole array can be overwritten with an invalid value.
+ * Sample usage:
+ * check_invalid_array_assignments(message, "to", false);
+ *
+ * @param obj object which has the array as its property
+ * @param array name of the array to check
+ * @param isNullable indicates if the array can be null
+ */
+function check_invalid_array_assignments(obj, array, isNullable) {
+    var args = [undefined, true, false, NaN, 0, "TIZEN", {}, function () {}],
+        val = obj[array], i;
+
+    if (!isNullable) {
+        obj[array] = null;
+        assert_not_equals(obj[array], null, "Non-nullable array was set to null");
+        assert_type(obj[array], "array", "Non-nullable array type changed after assigning null");
+        assert_equals(obj[array].toString(), val.toString(), "Non-nullable array contents changed after assigning null");
+    }
+
+    for (i = 0 ; i < args.length ; i++) {
+        obj[array] = args[i];
+        assert_type(obj[array], "array", "Array type changed after assigning an invalid value");
+        assert_equals(obj[array].toString(), val.toString(), "Array contents changed after assigning an invalid value");
+    }
+}
+
+/**
+ * Method to check if an object can be overwritten with an invalid value.
+ * Sample usage:
+ * check_invalid_object_assignments(message, "body", false);
+ *
+ * @param parentObj object which has the 'obj' object as its property
+ * @param obj name of the object to check
+ * @param isNullable indicates if the object can be null
+ */
+function check_invalid_obj_assignments(parentObj, obj, isNullable) {
+    var args = [undefined, true, false, NaN, 0, "TIZEN", function () {}],
+        val = parentObj[obj], i;
+
+    if (!isNullable) {
+        parentObj[obj] = null;
+        assert_equals(parentObj[obj], val, "Non-nullable obj was modified after assigning null");
+    }
+
+    for (i = 0 ; i < args.length ; i++) {
+        parentObj[obj] = args[i];
+        assert_equals(parentObj[obj], val, "The object was set to " + args[i]);
+    }
+}
+
+/**
+ * Method to validate conversion for listeners.
+ * Example usage:
+ * incorrectListeners = getListenerConversionExceptions(["oninstalled", "onupdated", "onuninstalled"]);
+ * for(i = 0; i < incorrectListeners.length; i++) {
+ *     packageInformationEventCallback  = incorrectListeners[i][0];
+ *     exceptionName = incorrectListeners[i][1];
+ *     assert_throws({name : exceptionName},
+ *        function () {
+ *             tizen.package.setPackageInfoEventListener(packageInformationEventCallback);
+ *         }, exceptionName + " should be thrown - given incorrect successCallback.");
+ * }
+ *
+ *
+ * @param callbackNames Array with names
+ * @returns {Array} table of tables which contain incorrect listener (index 0) and exceptionName (index 1)
+ *
+ */
+function getListenerConversionExceptions(callbackNames) {
+    var result = [], conversionTable, i, j, listenerName;
+    conversionTable = getTypeConversionExceptions("functionObject", false);
+
+    for (i = 0; i < callbackNames.length; i++) {
+        for (j = 0; j < conversionTable.length; j++) {
+            listenerName = {};
+            listenerName[callbackNames[i]] = conversionTable[j][0];
+            result.push([listenerName, conversionTable[j][1]]);
+        }
+    }
+
+    return result;
+}