[Bookmark] - various fixes
authorTomasz Paciorek <t.paciorek@samsung.com>
Tue, 8 Oct 2013 11:55:05 +0000 (13:55 +0200)
committerTomasz Paciorek <t.paciorek@samsung.com>
Tue, 8 Oct 2013 13:09:22 +0000 (15:09 +0200)
Change-Id: Idcad5cff9055e8cfda1c27c0327bdc7ce3415fb3

40 files changed:
tct-bookmark-tizen-tests/bookmark/BookmarkFolder_constructor.html
tct-bookmark-tizen-tests/bookmark/BookmarkFolder_exist.html
tct-bookmark-tizen-tests/bookmark/BookmarkFolder_extend.html
tct-bookmark-tizen-tests/bookmark/BookmarkFolder_parent_attribute.html
tct-bookmark-tizen-tests/bookmark/BookmarkFolder_title_attribute.html
tct-bookmark-tizen-tests/bookmark/BookmarkItem_constructor.html
tct-bookmark-tizen-tests/bookmark/BookmarkItem_exist.html
tct-bookmark-tizen-tests/bookmark/BookmarkItem_extend.html
tct-bookmark-tizen-tests/bookmark/BookmarkItem_parent_attribute.html
tct-bookmark-tizen-tests/bookmark/BookmarkItem_title_attribute.html
tct-bookmark-tizen-tests/bookmark/BookmarkItem_url_attribute.html
tct-bookmark-tizen-tests/bookmark/BookmarkManagerObject_notexist.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_add.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_add_bookmark_TypeMismatch.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_add_exist.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_add_invalid.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_add_missarg.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_add_parentFolder_TypeMismatch.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_add_parentFolder_invalid_obj.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_add_with_parentFolder.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_extend.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_get.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_get_exist.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_get_parentFolder_NotFound.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_get_parentFolder_TypeMismatch.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_get_parentFolder_invalid_obj.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_get_with_parentFolder.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_get_with_recursive.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_in_tizen.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_notexist.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_remove.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_remove_bookmarkFolder.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_remove_bookmark_TypeMismatch.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_remove_exist.html
tct-bookmark-tizen-tests/bookmark/BookmarkManager_remove_with_bookmark.html
tct-bookmark-tizen-tests/bookmark/Tizen_bookmark_exist.html
tct-bookmark-tizen-tests/bookmark/support/unitcommon.js [new file with mode: 0644]
tct-bookmark-tizen-tests/resources/unitcommon.js [deleted file]
tct-bookmark-tizen-tests/tests.full.xml
tct-bookmark-tizen-tests/tests.xml

index 645b29b3a4946185b37afeeecbce69d7fc471d03..98278462ef97f7d69c6868344c00c67d6b340f5c 100644 (file)
@@ -23,14 +23,14 @@ Authors:
 <head>
 <title>BookmarkFolder_constructor</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>
 <div id="log"></div>
 <script>
 //==== TEST: BookmarkFolder_constructor
-//==== LABEL check if the values of the attributes are equal to the arguments passed for BookmarkFolder
+//==== LABEL Check if the values of the attributes are equal to the arguments passed for BookmarkFolder
 //==== SPEC Tizen Web API:Social:Bookmark:BookmarkFolder:constructor C
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bookmark.html
 //==== TEST_CRITERIA CONSTRA CONSTRM
@@ -41,7 +41,7 @@ test(function () {
     assert_type(tizenB, "object", "BookmarkFolder constructor test.");
     assert_equals(tizenB.title, title, "title attribute test");
     assert_true("parent" in tizenB, "There is no parent");
-});
+}, document.title);
 
 </script>
 </body>
index 6f6a93ba06e4325bcad19b1659bb61c49756d036..134a536f70a9777297b0ab012c69f46a7003a7d3 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkFolder_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,8 +37,7 @@ Authors:
 
 test(function () {
     check_constructor("BookmarkFolder");
-}, "BookmarkFolder_exist");
-// Check if BookmarkFolder exists
+}, document.title);
 
 </script>
 </body>
index e0d474a13c9b1f28623e35b9cd18aab543d22a2f..669a3873b9a54e15bce05674f5c3e1799f9de7eb 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkFolder_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>
@@ -31,7 +31,7 @@ Authors:
 <script type="text/javascript">
 
 //==== TEST: BookmarkFolder_extend
-//==== LABEL test whether the BookmarkFolder object can have new attribute added
+//==== LABEL Test whether the BookmarkFolder object can have new attribute added
 //==== SPEC Tizen Web API:Social:Bookmark:BookmarkFolder:BookmarkFolder U
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bookmark.html
 //==== TEST_CRITERIA OBX
@@ -41,7 +41,7 @@ test(function () {
     var title = "tizen", tizenB;
     tizenB = new tizen.BookmarkFolder(title);
     check_extensibility(tizenB);
-});
+}, document.title);
 
 </script>
 </body>
index 2dd7c6bce8084368dacdf92864ea20607008b8fa..79a1114ea83f369de2d8104fa6f26ed31e41481f 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>BookmarkFolder_parent_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>
@@ -60,7 +60,7 @@ test(function () {
 
     tizen.bookmark.remove();
 
-}, "BookmarkFolder_parent_attribute");
+}, document.title);
 
 </script>
 </body>
index 0d9289a3e770ee0a66a31c6a897df9085005b069..d20d595d1f3fe39f003883c0d2b1d29dc2111f17 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkFolder_title_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 () {
     assert_type(bookmarkfolder.title, "string", "Type of title is not DOMString.");
     assert_equals(bookmarkfolder.title, "Testfolder", "Attribute title has invalid value");
     check_readonly(bookmarkfolder, "title", "Testfolder", "string", "DummyValue");
-}, "BookmarkFolder_title_attribute");
+}, document.title);
 
 </script>
 </body>
index db1b4ab2905bb39c8cead3a8e7fa7e5dc0dfc00a..dbe22294af7fd918ddcdce2d3251f23e1afb45af 100644 (file)
@@ -23,14 +23,14 @@ Authors:
 <head>
 <title>BookmarkItem_constructor</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>
 <div id="log"></div>
 <script>
 //==== TEST: BookmarkItem_constructor
-//==== LABEL check if the values of the attributes are equal to the arguments passed
+//==== LABEL Check if the values of the attributes are equal to the arguments passed
 //==== SPEC Tizen Web API:Social:Bookmark:BookmarkItem:constructor C
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bookmark.html
 //==== TEST_CRITERIA CONSTRA CONSTRM
@@ -42,7 +42,7 @@ test(function () {
     assert_equals(tizenB.title, title, "title attribute test");
     assert_equals(tizenB.url, url, "url attribute test");
     assert_true("parent" in tizenB, "There is no parent");
-});
+}, document.title);
 
 </script>
 </body>
index ef596c8d07aaed4bbdc8a0e177c0daefc47a9694..782c1ea8cb6d4773a0ca16e6fab554437474937b 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkItem_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,8 +37,7 @@ Authors:
 
 test(function () {
     check_constructor("BookmarkItem");
-}, "BookmarkItem_exist");
-// Check if BookmarkItem exists
+}, document.title);
 
 </script>
 </body>
index 6e1b32b84c66c7c9a5f78c7e5f188228cf2338ff..b64614334879055ddd25588f056a95aad7a39060 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkItem_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>
@@ -31,7 +31,7 @@ Authors:
 <script type="text/javascript">
 
 //==== TEST: BookmarkItem_extend
-//==== LABEL test whether the BookmarkItem object can have new attribute added
+//==== LABEL Test whether the BookmarkItem object can have new attribute added
 //==== SPEC Tizen Web API:Social:Bookmark:BookmarkItem:BookmarkItem U
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bookmark.html
 //==== TEST_CRITERIA OBX
@@ -41,7 +41,7 @@ test(function () {
     var title = "tizen", url = "https://www.tizen.org", tizenB;
     tizenB = new tizen.BookmarkItem(title, url);
     check_extensibility(tizenB);
-});
+}, document.title);
 
 </script>
 </body>
index b20f2e1d4cf7aa5d20858375cf56d2ec0eba1b22..b54f65fab37734076ee0ca23aa6e8552634835a1 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>BookmarkItem_parent_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>
@@ -62,7 +62,7 @@ test(function () {
 
     tizen.bookmark.remove();
 
-}, "BookmarkItem_parent_attribute");
+}, document.title);
 
 </script>
 </body>
index 472c4ce4fe46dd14b6debbeb1477bdab987c0cd9..daa74140b415917d37a37e57b768b1e632eb296f 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkItem_title_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>
@@ -43,7 +43,7 @@ test(function () {
     assert_type(bookmarkitem.title, "string", "Type of title is not DOMString.");
     assert_equals(bookmarkitem.title, "Tizen", "Attribute title has invalid value");
     check_readonly(bookmarkitem, "title", "Tizen", "string", "DummyValue");
-}, "BookmarkItem_title_attribute");
+}, document.title);
 
 </script>
 </body>
index 606a04b395a87ab1bee75145c448a088bbc97e4f..102223e8045314b863f18a30220409df0618c39c 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkItem_url_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>
@@ -43,7 +43,7 @@ test(function () {
     assert_type(bookmarkitem.url, "string", "Type of url is not DOMString.");
     assert_equals(bookmarkitem.url, "https://tizen.org/", "Attribute url has invalid value");
     check_readonly(bookmarkitem, "url", "https://tizen.org/", "string", "DummyValue");
-}, "BookmarkItem_url_attribute");
+}, document.title);
 
 </script>
 </body>
index 3f163117f87a99c59bc5d388ffaa69b85c85603f..d1ec6e64ad5b19f8c162a3832672f409ebc0c1ac 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManagerObject_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>
@@ -38,8 +38,7 @@ Authors:
 
 test(function () {
     check_no_interface_object("BookmarkManagerObject");
-}, "BookmarkManagerObject_notexist");
-// Check if interface BookmarkManagerObject exists, it should not.
+}, document.title);
 
 </script>
 </body>
index 04a6c9d934146d7e46f08bd0fb9184b3d6f2894f..55323f97143511e8781fb2f7729b67cc39782b53 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_add</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>
@@ -51,7 +51,7 @@ test(function () {
     assert_equals(ret[0].url, bookmark.url, "bookmark.url");
 
     tizen.bookmark.remove();
-}, "BookmarkManager_add");
+}, document.title);
 
 </script>
 </body>
index 8e376777d01b85a8093fb3a75acbdcb59a4c84f8..0d4dd5ef4f4b8f645ad40332ecc772e1101bda21 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_add_bookmark_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>
@@ -51,7 +51,7 @@ test(function () {
             tizen.bookmark.add(bookmark);
         }, exceptionName + " should be thrown - given incorrect bookmark.");
     }
-});
+}, document.title);
 
 </script>
 </body>
index 546a6ffb7c8330c3b282781a60591a3271a79cd7..6dd0821eaebdcdf0058d71555a9848a34169078e 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_add_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>
@@ -38,7 +38,7 @@ Authors:
 test(function () {
     assert_true("add" in tizen.bookmark, "No add method in tizen.bookmarkmanager");
     check_method_exists(tizen.bookmark, "add");
-}, "BookmarkManager_add_exist");
+}, document.title);
 
 </script>
 </body>
index fd15bad716ee4c0705c5178cb58ad6be9c9769d4..31f8c2a05e374bdf8dff0071b85bd96aa22bba6a 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_add_invalid</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,7 +45,7 @@ test(function () {
     tizen.bookmark.remove();
 
     // parent not in database
-    assert_throws({name: "NotFoundError"}, function () {
+    assert_throws(NOT_FOUND_EXCEPTION, function () {
         tizen.bookmark.add(bookmark, folder);
     }, "parent not in database");
 
@@ -53,17 +53,17 @@ test(function () {
     tizen.bookmark.add(bookmark, folder);
 
     // conflicting url
-    assert_throws({name: "InvalidValuesError"}, function () {
+    assert_throws(INVALID_VALUES_EXCEPTION, function () {
         tizen.bookmark.add(new tizen.BookmarkItem("newBookmark", bookmark.url));
     }, "url conflict");
 
     // conflicting folder name
-    assert_throws({name: "InvalidValuesError"}, function () {
+    assert_throws(INVALID_VALUES_EXCEPTION, function () {
         tizen.bookmark.add(new tizen.BookmarkFolder(folder.title));
     }, "folder name conflict w/folder");
 
     tizen.bookmark.remove();
-}, "BookmarkManager_add");
+}, document.title);
 
 </script>
 </body>
index 918bc5aec3b2c4629d1446039afaf3f317a65b1b..5280cd5e7c74b8ad399cb1c4267d845f9322e1cd 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_add_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>
@@ -36,12 +36,10 @@ Authors:
 //==== TEST_CRITERIA MMA
 
 test(function () {
-    assert_throws({
-        name: "TypeMismatchError"
-    }, function () {
+    assert_throws(TYPE_MISMATCH_EXCEPTION, function () {
         tizen.bookmark.add();
     }, "TypeMismatchError should be thrown");
-});
+}, document.title);
 
 </script>
 </body>
index 1ffc1ee7edfa7b1e878b5b7bdfdb80d612090579..35eb52b0921623c08db3f686d1d865ad1d039245 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_add_parentFolder_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>
@@ -46,12 +46,12 @@ test(function () {
         parentFolder = conversionTable[i][0];
         exceptionName = conversionTable[i][1];
 
-        assert_throws({name : exceptionName},
+        assert_throws({name: exceptionName},
             function () {
                 tizen.bookmark.add(item, parentFolder);
             }, exceptionName + " should be thrown - given incorrect parentFolder.");
     }
-});
+}, document.title);
 
 </script>
 </body>
index 79bf0fb68b76fdeeab8a5f4248b8aeb104d89cac..1fd1d450e979c950f64aafe846b60deb6edad498 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_add_parentFolder_invalid_obj</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>
@@ -58,7 +58,7 @@ test(function () {
     }, exceptionName + " should be thrown - given incorrect parentFolder argument.");
 
     tizen.bookmark.remove();
-});
+}, document.title);
 
 </script>
 </body>
index 72c92d12e2ec785b97d37760b2e4a13f72f2796d..e730c4adc5f02872d08ccc81732dde59a3ae4890 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_add_with_parentFolder</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>
@@ -53,7 +53,7 @@ test(function () {
     assert_equals(ret[0].parent.title, tizenB.title, "bookmark.parent.title");
 
     tizen.bookmark.remove();
-});
+}, document.title);
 
 </script>
 </body>
index dab12de669d29d16955f103777ac65410399cce9..f68185c29d853fafd539a7ded4424a31c426f8c6 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_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>
@@ -31,7 +31,7 @@ Authors:
 <script type="text/javascript">
 
 //==== TEST: BookmarkManager_extend
-//==== LABEL test whether the BookmarkManager object can have new attribute added
+//==== LABEL Test whether the BookmarkManager object can have new attribute added
 //==== SPEC Tizen Web API:Social:Bookmark:BookmarkManager:BookmarkManager U
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bookmark.html
 //==== TEST_CRITERIA OBX
@@ -39,7 +39,7 @@ Authors:
 
 test(function () {
     check_extensibility(tizen.bookmark);
-});
+}, document.title);
 
 </script>
 </body>
index 091f8c545364cac6ae80a9209c2811624c462c3e..76c420d8608ff85327dcc7561d51aa8cab88365b 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>BookmarkManager_get</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>
@@ -54,7 +54,7 @@ test(function () {
 
     tizen.bookmark.remove();
 
-}, "BookmarkManager_get");
+}, document.title);
 
 </script>
 </body>
index 91715e7cf6dcdda5ef61b7a64ad047c4e6b402ca..362c2e13b40551a712714ef4cb1002aa5ef60757 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_get_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>
@@ -38,7 +38,7 @@ Authors:
 test(function () {
     assert_true("get" in tizen.bookmark, "No get method in tizen.bookmarkmanager");
     check_method_exists(tizen.bookmark, "get");
-}, "BookmarkManager_get_exist");
+}, document.title);
 
 </script>
 </body>
index 3c18bb8a34e41321dc7d0df409cd8960de08c650..b4a75054aef1434398f793100e53f9187aa5f734 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_get_parentFolder_NotFound</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,12 +43,12 @@ test(function () {
 
     folder = new tizen.BookmarkFolder(title);
 
-    assert_throws({name: "NotFoundError"}, function () {
+    assert_throws(NOT_FOUND_EXCEPTION, function () {
         tizen.bookmark.get(folder);
     });
 
     tizen.bookmark.remove();
-}, "BookmarkManager_get_parentFolder_NotFound");
+}, document.title);
 
 </script>
 </body>
index b570e135eefbf71ade2747529633e5a6c5fe7152..810b96a13fc19ca9ddd7174e2dc027d04c6dc453 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_get_parentFolder_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>
@@ -51,7 +51,7 @@ test(function () {
             ret = tizen.bookmark.get(parentFolder);
         }, exceptionName + " should be thrown - given incorrect parentFolder.");
     }
-});
+}, document.title);
 
 </script>
 </body>
index 435291a07d5d39b136d288fd753b481ad5c07e94..4586699d1a5a2443e99c3b2c3f0d738abbb7c196 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>BookmarkManager_get_parentFolder_invalid_obj</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 () {
     tizen.bookmark.remove();
     tizen.bookmark.add(bookmarkFolder);
     fakedParentFolder = {parent: bookmarkFolder, title: "title"};
-    assert_throws({name : exceptionName},
+    assert_throws({name: exceptionName},
         function () {
             tizen.bookmark.get(fakedParentFolder);
         }, exceptionName + " should be thrown - given incorrect parentFolder argument.");
     tizen.bookmark.remove();
-});
+}, document.title);
 
 </script>
 </body>
index fbf30a703f14b860ec2f0363c5054e537d343206..d28372a61f1bf3e84e0e3966f2e215d92d10c8bb 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_get_with_parentFolder</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>
@@ -54,7 +54,7 @@ test(function () {
     assert_equals(ret[0].parent.title, tizenB.title, "Attribute parent in returned object should be null");
 
     tizen.bookmark.remove();
-});
+}, document.title);
 
 </script>
 </body>
index 7f4b4e6f7573801d6e8cd0f299a843ae005f588b..a02e11b6cdc5e89cdd01e85db6f3e4ff6001e7ff 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_get_with_recursive</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>
@@ -72,7 +72,7 @@ test(function () {
     assert_equals(retrievedParent.parent, null, "parent.parent");
 
     tizen.bookmark.remove();
-});
+}, document.title);
 
 </script>
 </body>
index 9f369d91fe7f07d93028aa4e26097e56e68b9f78..20dee4bdad55b2211a5536402a1543187304ab88 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_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>
@@ -31,7 +31,7 @@ Authors:
 <script type="text/javascript">
 
 //==== TEST: BookmarkManager_in_tizen
-//==== LABEL check attribute bookmark
+//==== LABEL Check attribute bookmark
 //==== SPEC Tizen Web API:Social:Bookmark:BookmarkManager:BookmarkManager U
 //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bookmark.html
 //==== TEST_CRITERIA OBME
@@ -39,7 +39,7 @@ Authors:
 
 test(function () {
     check_readonly(tizen, "bookmark", tizen.bookmark, "object", "Tizen");
-});
+}, document.title);
 
 </script>
 </body>
index bb06825c52f7586636dd2da896c44ca12a98b645..e1a9dd2dca7833d65a2f5308f17641c9a9de505f 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_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>
@@ -38,8 +38,7 @@ Authors:
 
 test(function () {
     check_no_interface_object("BookmarkManager");
-}, "BookmarkManager_notexist");
-// Check if interface BookmarkManager exists, it should not.
+}, document.title);
 
 </script>
 </body>
index bbf3a3b9e170f586bb1c74a36577ecf673debd0e..31b9af03c737f38fce48e13ad4a475b2a18274aa 100644 (file)
@@ -24,7 +24,7 @@ Authors:
 <head>
 <title>BookmarkManager_remove</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>
@@ -49,7 +49,7 @@ test(function () {
     ret = tizen.bookmark.get();
     assert_equals(ret.length, 0, "bookmarks are not removed");
 
-});
+}, document.title);
 
 </script>
 </body>
index 036c83a24c2e576b1cd3957b0930f2fc466de830..80df7f16324632dcea584ceb12fc5c929028cfba 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_remove_bookmarkFolder</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>
@@ -52,7 +52,7 @@ test(function () {
     ret = tizen.bookmark.get(null, true);
     assert_equals(ret.length, 0, "bookmarks are not removed");
 
-}, "BookmarkManager_remove_bookmarkFolder");
+}, document.title);
 
 </script>
 </body>
index e0975e3e729b7a57b02c3eb7f1a3868bd4b11bf3..6858635e41644f83a8b4da0f749b0877b3f3418f 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_remove_bookmark_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>
@@ -51,7 +51,7 @@ test(function () {
             ret = tizen.bookmark.remove(bookmark);
         }, exceptionName + " should be thrown - given incorrect bookmark.");
     }
-});
+}, document.title);
 
 </script>
 </body>
index 33210ee527e7e90e801e2afd2aac760646080210..b55b66ef63476ef57808e96bb6b774bd98f75fa3 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_remove_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>
@@ -38,7 +38,7 @@ Authors:
 test(function () {
     assert_true("remove" in tizen.bookmark, "No remove method in tizen.bookmarkmanager");
     check_method_exists(tizen.bookmark, "remove");
-}, "BookmarkManager_remove_exist");
+}, document.title);
 
 </script>
 </body>
index 9d834c4d1695d4ee8e441d008c36037acdcf85ab..c87b07735be69dbc7ee1fa9babc5efa290ccc7df 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>BookmarkManager_remove_with_bookmark</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>
@@ -51,7 +51,7 @@ test(function () {
     }
     ret = tizen.bookmark.get();
     assert_equals(ret.length, 0, "bookmarks are not removed");
-});
+}, document.title);
 
 </script>
 </body>
index 58e1ce3cefb12e51d98aa66a6dd287167b353053..f8513d56d6cf7c48680b4253f8ff87e76e5adc68 100644 (file)
@@ -23,7 +23,7 @@ Authors:
 <head>
 <title>Tizen_bookmark_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,8 +39,7 @@ Authors:
 test(function () {
     assert_own_property(tizen, "bookmark", "Tizen should implement BookmarkManagerObject");
     assert_equals(typeof(tizen.bookmark), "object", "tizen.bookmark should be object");
-}, "Tizen_bookmark_exist");
-// Check if bookmark exists in tizen
+}, document.title);
 
 </script>
 </body>
diff --git a/tct-bookmark-tizen-tests/bookmark/support/unitcommon.js b/tct-bookmark-tizen-tests/bookmark/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;
+}
diff --git a/tct-bookmark-tizen-tests/resources/unitcommon.js b/tct-bookmark-tizen-tests/resources/unitcommon.js
deleted file mode 100644 (file)
index 9f972c1..0000000
+++ /dev/null
@@ -1,559 +0,0 @@
-/*
-
-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;
-}
index a1bdffb8a1e2271929ce1b3a46715b1458222f95..7289e92eb1c99abd723ebec6de7c5ab5df4d000a 100644 (file)
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="check attribute bookmark" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P3" id="BookmarkManager_in_tizen">
+      <testcase purpose="Check attribute bookmark" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P3" id="BookmarkManager_in_tizen">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkManager_in_tizen.html</test_script_entry>
         </description>
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="test whether the BookmarkManager object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P3" id="BookmarkManager_extend">
+      <testcase purpose="Test whether the BookmarkManager object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P3" id="BookmarkManager_extend">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkManager_extend.html</test_script_entry>
         </description>
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="check if the values of the attributes are equal to the arguments passed" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P1" id="BookmarkItem_constructor">
+      <testcase purpose="Check if the values of the attributes are equal to the arguments passed" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P1" id="BookmarkItem_constructor">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkItem_constructor.html</test_script_entry>
         </description>
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="check if the values of the attributes are equal to the arguments passed for BookmarkFolder" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P1" id="BookmarkFolder_constructor">
+      <testcase purpose="Check if the values of the attributes are equal to the arguments passed for BookmarkFolder" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P1" id="BookmarkFolder_constructor">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkFolder_constructor.html</test_script_entry>
         </description>
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="test whether the BookmarkItem object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P3" id="BookmarkItem_extend">
+      <testcase purpose="Test whether the BookmarkItem object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P3" id="BookmarkItem_extend">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkItem_extend.html</test_script_entry>
         </description>
           </spec>
         </specs>
       </testcase>
-      <testcase purpose="test whether the BookmarkFolder object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P3" id="BookmarkFolder_extend">
+      <testcase purpose="Test whether the BookmarkFolder object can have new attribute added" type="compliance" status="approved" component="TizenAPI/Social/Bookmark" execution_type="auto" priority="P3" id="BookmarkFolder_extend">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkFolder_extend.html</test_script_entry>
         </description>
index 69d1c27313297ab4db517eed6b797277257dff57..e1671669970d519167b7c25a3c8a1572975e7510 100644 (file)
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkManager_remove_bookmark_TypeMismatch.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="check attribute bookmark" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkManager_in_tizen">
+      <testcase purpose="Check attribute bookmark" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkManager_in_tizen">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkManager_in_tizen.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="test whether the BookmarkManager object can have new attribute added" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkManager_extend">
+      <testcase purpose="Test whether the BookmarkManager object can have new attribute added" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkManager_extend">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkManager_extend.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="check if the values of the attributes are equal to the arguments passed" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkItem_constructor">
+      <testcase purpose="Check if the values of the attributes are equal to the arguments passed" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkItem_constructor">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkItem_constructor.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="check if the values of the attributes are equal to the arguments passed for BookmarkFolder" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkFolder_constructor">
+      <testcase purpose="Check if the values of the attributes are equal to the arguments passed for BookmarkFolder" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkFolder_constructor">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkFolder_constructor.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="test whether the BookmarkItem object can have new attribute added" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkItem_extend">
+      <testcase purpose="Test whether the BookmarkItem object can have new attribute added" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkItem_extend">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkItem_extend.html</test_script_entry>
         </description>
       </testcase>
-      <testcase purpose="test whether the BookmarkFolder object can have new attribute added" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkFolder_extend">
+      <testcase purpose="Test whether the BookmarkFolder object can have new attribute added" component="TizenAPI/Social/Bookmark" execution_type="auto" id="BookmarkFolder_extend">
         <description>
           <test_script_entry>/opt/tct-bookmark-tizen-tests/bookmark/BookmarkFolder_extend.html</test_script_entry>
         </description>