--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist\r
+//==== LABEL Check if ContentManager createPlaylist method without optional arguments works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MMINA MR\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, removePlaylistSuccess, removePlaylistFail, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_equals(retVal, undefined, "createPlaylist should return undefined");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ retVal = tizen.content.createPlaylist(randomString(5), createSuccess);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_errorCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_errorCallback_TypeMismatch\r
+//==== LABEL Check if createPlaylist throws exception when errorCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), conversionTable, successCallback, errorCallback, exceptionName, i;\r
+\r
+t.step(function () {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+\r
+ successCallback = t.step_func(function (playlist) {\r
+ assert_unreached("createPlaylist() success callback should not be invoked.");\r
+ });\r
+\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ errorCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ tizen.content.createPlaylist("My new playlist", successCallback, errorCallback);\r
+ }, "Given incorrect error callback.");\r
+ }\r
+\r
+ t.done();\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_errorCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_errorCallback_invalid_cb\r
+//==== LABEL Check if createPlaylist throws exception when errorCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), successCallback, incorrectCallback;\r
+\r
+t.step(function () {\r
+ incorrectCallback = {\r
+ onerror: t.step_func(function (error) {\r
+ assert_unreached("Invalid error callback invoked:" + error.name + ": " + error.message);\r
+ })\r
+ };\r
+\r
+ successCallback = t.step_func(function (playlist) {\r
+ assert_unreached("createPlaylist() success callback should not be invoked.");\r
+ });\r
+\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ tizen.content.createPlaylist("newplaylist", successCallback, incorrectCallback);\r
+ }, "Given incorrect errorCallback.");\r
+\r
+ t.done();\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_errorCallback_invoked</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_errorCallback_invoked\r
+//==== LABEL Check if ContentManager createPlaylist method with invalid arguments would invoke errorCallback\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MERRCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), createSuccess, createFail;\r
+\r
+t.step(function () {\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_unreached("createPlaylist() success callback unreachable");\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_equals(error.name, "InvalidValuesError", "Incorrect error name");\r
+ assert_type(error.message, "string", "Error message is not a string");\r
+ assert_not_equals(error.message, "","Error message is empty");\r
+ t.done();\r
+ });\r
+\r
+ tizen.content.createPlaylist("", createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_exist\r
+//==== LABEL Check if createPlaylist exists\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+test(function () {\r
+ assert_true("createPlaylist" in tizen.content, "ContentManager should have createPlaylist method");\r
+ check_method_exists(tizen.content, "createPlaylist");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_misarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_misarg\r
+//==== LABEL Check if createPlaylist method called with missing non-optional argument throws an exception\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+test(function () {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ tizen.content.createPlaylist("newPlaylist");\r
+ }, "Invoked with non-optional arguments.");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_noarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_noarg\r
+//==== LABEL Check if createPlaylist method called with missing non-optional argument throws an exception\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+test(function () {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ tizen.content.createPlaylist();\r
+ }, "Invoked with non-optional arguments.");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_sourcePlaylist_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_sourcePlaylist_TypeMismatch\r
+//==== LABEL Check if createPlaylist throws exception when sourcePlaylist is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), conversionTable, successCallback, errorCallback, exceptionName, i, sourcePlaylist;\r
+\r
+t.step(function () {\r
+ conversionTable = getTypeConversionExceptions("object", true);\r
+\r
+ successCallback = t.step_func(function (playlist) {\r
+ assert_unreached("createPlaylist() success callback should not be invoked.");\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback should not be invoked.");\r
+ });\r
+\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ sourcePlaylist = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ tizen.content.createPlaylist("My new playlist", successCallback, errorCallback, sourcePlaylist);\r
+ }, "Given incorrect error callback.");\r
+ }\r
+\r
+ t.done();\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_successCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_successCallback_TypeMismatch\r
+//==== LABEL Check if createPlaylist throws exception when successCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), conversionTable, successCallback, errorCallback, exceptionName, i;\r
+\r
+t.step(function () {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ successCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ tizen.content.createPlaylist("My new playlist", successCallback, errorCallback);\r
+ }, "Given incorrect success callback.");\r
+ }\r
+\r
+ t.done();\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_successCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_successCallback_invalid_cb\r
+//==== LABEL Check if createPlaylist throws exception when success callback is invalid\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+test(function () {\r
+ var incorrectCallback;\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function (playlist) {\r
+ assert_unreached("Invalid success callback invoked.");\r
+ }\r
+ };\r
+\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION,\r
+ function () {\r
+ tizen.content.createPlaylist("newplaylist", incorrectCallback);\r
+ }, "Given invalid successCallback.");\r
+\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_createPlaylist_with_sourcePlaylist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_createPlaylist_with_sourcePlaylist\r
+//==== LABEL Check if ContentManager createPlaylist method with all optional arguments works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:createPlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MOA MAST\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), successCallback, errorCallback, getSuccessCallback, getErrorCallback, gPlaylist,\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail, successCb, errorCb, beforelength = 0, afterlength = 0, id;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCb = t.step_func(function (playlists) {\r
+ afterlength = playlists.length;\r
+ assert_greater_than(afterlength, beforelength, "length increase");\r
+ tizen.content.removePlaylist(id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCb = t.step_func(function (error) {\r
+ assert_unreached("getPlaylists() error callback(after create) was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ id = playlist.id;\r
+ tizen.content.getPlaylists(successCb, errorCb);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ getSuccessCallback = t.step_func(function (playlists) {\r
+ beforelength = playlists.length;\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail, gPlaylist);\r
+ });\r
+\r
+ getErrorCallback = t.step_func(function (error) {\r
+ assert_unreached("getPlaylists() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.getPlaylists(getSuccessCallback, getErrorCallback);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), successCallback, errorCallback);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_getPlaylists</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_getPlaylists\r
+//==== LABEL Check if ContentManager getPlaylists method without optional error callback works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:getPlaylists M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MMINA MR\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), successCallback, createSuccess, createFail, gPlaylist, removePlaylistSuccess, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ successCallback = t.step_func(function (playlists) {\r
+ assert_equals(retVal, undefined, "getPlaylists should return undefined");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ retVal = tizen.content.getPlaylists(successCallback);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_getPlaylists_errorCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_getPlaylists_errorCallback_TypeMismatch\r
+//==== LABEL Check if getPlaylists throws exception when errorCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:getPlaylists M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), conversionTable, successCallback, errorCallback, exceptionName, i;\r
+\r
+t.step(function () {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("getPlaylists() success callback should not be invoked.");\r
+ });\r
+\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ errorCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ tizen.content.getPlaylists(successCallback, errorCallback);\r
+ }, "Given incorrect error callback.");\r
+ }\r
+\r
+ t.done();\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_getPlaylists_errorCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_getPlaylists_errorCallback_invalid_cb\r
+//==== LABEL Check if getPlaylists throws exception when errorCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:getPlaylists M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), successCallback, incorrectCallback;\r
+\r
+t.step(function () {\r
+\r
+ incorrectCallback = {\r
+ onerror: t.step_func(function (error) {\r
+ assert_unreached("Invalid error callback invoked:" + error.name + ": " + error.message);\r
+ })\r
+ };\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("getPlaylists() success callback should not be invoked.");\r
+ });\r
+\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ tizen.content.getPlaylists(successCallback, incorrectCallback);\r
+ }, "Given incorrect errorCallback.");\r
+\r
+ t.done();\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_getPlaylists_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_getPlaylists_exist\r
+//==== LABEL Check if getPlaylists exists\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:getPlaylists M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+test(function () {\r
+ assert_true("getPlaylists" in tizen.content, "ContentManager should have getPlaylists method");\r
+ check_method_exists(tizen.content, "getPlaylists");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_getPlaylists_misarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_getPlaylists_misarg\r
+//==== LABEL Check if getPlaylists method called with missing non-optional argument throws an exception\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:getPlaylists M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+test(function () {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ tizen.content.getPlaylists();\r
+ }, "Invoked with non-optional arguments.");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_getPlaylists_successCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_getPlaylists_successCallback_TypeMismatch\r
+//==== LABEL Check if getPlaylists throws exception when successCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:getPlaylists M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), conversionTable, successCallback, errorCallback, exceptionName, i;\r
+\r
+t.step(function () {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("getPlaylists() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ successCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ tizen.content.getPlaylists(successCallback, errorCallback);\r
+ }, "Given incorrect success callback.");\r
+ }\r
+\r
+ t.done();\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_getPlaylists_successCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_getPlaylists_successCallback_invalid_cb\r
+//==== LABEL Check if getPlaylists throws exception when success callback is invalid\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:getPlaylists M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+test(function () {\r
+ var incorrectCallback;\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function (playlists) {\r
+ assert_unreached("Invalid success callback invoked.");\r
+ }\r
+ };\r
+\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION,\r
+ function () {\r
+ tizen.content.getPlaylists(incorrectCallback);\r
+ }, "Given invalid successCallback.");\r
+\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_getPlaylists_with_errorCallback</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_getPlaylists_with_errorCallback\r
+//==== LABEL Check if ContentManager getPlaylists method with optional error callback is invoked properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:getPlaylists M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MOA MR\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), successCallback, errorCallback, createSuccess, createFail, removePlaylistSuccess, gPlaylist, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ successCallback = t.step_func(function (playlists) {\r
+ assert_equals(retVal, undefined, "getPlaylists should return undefined");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("getPlaylists() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ retVal = tizen.content.getPlaylists(successCallback, errorCallback);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_removePlaylist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_removePlaylist\r
+//==== LABEL Check if ContentManager removePlaylist method without optional arguments works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:removePlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MMINA MR\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ assert_equals(retVal, undefined, "removePlaylist should return undefined");\r
+ t.done();\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ retVal = tizen.content.removePlaylist(playlist.id, removePlaylistSuccess);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_removePlaylist_errorCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_removePlaylist_errorCallback_TypeMismatch\r
+//==== LABEL Check if removePlaylist throws exception when successCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:removePlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, exceptionName, conversionTable, i, successCallback, errorCallback, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("removePlaylist() success callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ errorCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ tizen.content.removePlaylist(playlist.id, successCallback, errorCallback);\r
+ }, "Given incorrect success callback.");\r
+ }\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail)\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_removePlaylist_errorCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_removePlaylist_errorCallback_invalid_cb\r
+//==== LABEL Check if removePlaylist throws exception when errorCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:removePlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, incorrectCallback, successCallback, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onerror: function (error) {\r
+ assert_unreached("Invalid errorCallback invoked:" + error.name + " msg: " + error.message);\r
+ }\r
+ };\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("removePlaylist() success callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ tizen.content.removePlaylist(playlist.id, successCallback, incorrectCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail)\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_removePlaylist_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_removePlaylist_exist\r
+//==== LABEL Check if removePlaylist exists\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:removePlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+test(function () {\r
+ assert_true("removePlaylist" in tizen.content, "ContentManager should have removePlaylist method");\r
+ check_method_exists(tizen.content, "removePlaylist");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_removePlaylist_misarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_removePlaylist_misarg\r
+//==== LABEL Check if removePlaylist method called with missing non-optional argument throws an exception\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:removePlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+test(function () {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ tizen.content.removePlaylist();\r
+ }, "Invoked with non-optional arguments.");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_removePlaylist_successCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_removePlaylist_successCallback_TypeMismatch\r
+//==== LABEL Check if removePlaylist throws exception when success callback is invalid\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:removePlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, exceptionName, conversionTable, i, successCallback, errorCallback, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ successCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ tizen.content.removePlaylist(playlist.id, successCallback, errorCallback);\r
+ }, "Given incorrect success callback.");\r
+ }\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail)\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_removePlaylist_successCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_removePlaylist_successCallback_invalid_cb\r
+//==== LABEL Check if createPlaylist throws exception when successCallback is invalid\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:removePlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, incorrectCallback, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function () {\r
+ assert_unreached("Invalid successCallback invoked.");\r
+ }\r
+ };\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ tizen.content.removePlaylist(playlist.id, incorrectCallback);\r
+ }, "Given incorrect successCallback.");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail)\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>ContentManager_removePlaylist_with_errorCallback</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: ContentManager_removePlaylist_with_errorCallback\r
+//==== LABEL Check if ContentManager removePlaylist method with optional arguments works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:ContentManager:removePlaylist M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MOA MAST\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, successCallback, errorCallback, removePlaylistSuccess, removePlaylistFail, successCb, errorCb,\r
+ beforelength = 0, afterlength = 0, id;\r
+\r
+t.step(function () {\r
+ successCb = t.step_func(function (playlists) {\r
+ afterlength = playlists.length;\r
+ assert_less_than(afterlength, beforelength, "length shoulddecrease");\r
+ assert_equals(afterlength, beforelength-1, "length should decrease");\r
+ t.done();\r
+ });\r
+\r
+ errorCb = t.step_func(function (error) {\r
+ assert_unreached("getPlaylists() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ tizen.content.getPlaylists(successCb, errorCb);\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (playlists) {\r
+ beforelength = playlists.length;\r
+ tizen.content.removePlaylist(id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("getPlaylists() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ id = playlist.id;\r
+ tizen.content.getPlaylists(successCallback, errorCallback);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>PlaylistArraySuccessCallback_notexist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: PlaylistArraySuccessCallback_notexist\r
+//==== LABEL Check if interface PlaylistArraySuccessCallback exists,it should not\r
+//==== SPEC Tizen Web API:Content:Content:PlaylistArraySuccessCallback:PlaylistArraySuccessCallback U\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P3\r
+//==== TEST_CRITERIA CBNIO\r
+\r
+test(function () {\r
+ check_no_interface_object("PlaylistArraySuccessCallback");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>PlaylistArraySuccessCallback_onsuccess</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: PlaylistArraySuccessCallback_onsuccess\r
+//==== LABEL Check if PlaylistArraySuccessCallback onsuccess is called and if its arguments have proper type\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:PlaylistArraySuccessCallback:onsuccess M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA CBT CBOA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), successCallback, errorCallback, createSuccess, createFail, removePlaylistSuccess, gPlaylist, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ successCallback = t.step_func(function (playlists) {\r
+ assert_equals(retVal, undefined, "getPlaylists should return undefined");\r
+ assert_type(playlists, "array", "playlists should be an array");\r
+ assert_type(playlists[0], "object", "Incorrect type.");\r
+ assert_type(playlists[0].id, "string", "id type check");\r
+ assert_type(playlists[0].name, "string", "name type check");\r
+ assert_type(playlists[0].numberOfTracks, "long", "numberOfTracks type check");\r
+ assert_equals(playlists[0].thumbnailURI, null, "thumbnailURI type check");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("getPlaylists() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ retVal = tizen.content.getPlaylists(successCallback, errorCallback);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>PlaylistItemArraySuccessCallback_notexist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST:PlaylistItemArraySuccessCallback_notexist\r
+//==== LABEL Check if interface PlaylistItemArraySuccessCallback exists,it should not\r
+//==== SPEC Tizen Web API:Content:Content:PlaylistItemArraySuccessCallback:PlaylistItemArraySuccessCallback U\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P3\r
+//==== TEST_CRITERIA CBNIO\r
+\r
+test(function () {\r
+ check_no_interface_object("PlaylistItemArraySuccessCallback");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>PlaylistItemArraySuccessCallback_onsuccess</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: PlaylistItemArraySuccessCallback_onsuccess\r
+//==== LABEL Check if PlaylistItemArraySuccessCallback onsuccess is called and if its arguments have proper type\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:PlaylistItemArraySuccessCallback:onsuccess M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA CBT CBOA\r
+\r
+setup({timeout: 90000});\r
+\r
+var t = async_test(document.title, {timeout: 90000}),\r
+ findSuccess, findFail, createSuccess, createFail, onSuccess, onError,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ onSuccess = t.step_func(function (items) {\r
+ assert_type(items, "array", "items should be an array");\r
+ assert_type(items[0].content, "object", "content type check");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ onError = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ gPlaylist.get(onSuccess, onError);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>PlaylistItem_content_attribute</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: PlaylistItem_content_attribute\r
+//==== LABEL Check if interface PlaylistItem have content attribute with proper type and is readonly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:PlaylistItem:content A\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA AE AT ARO\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ assert_equals(items.length, 1 ,"Playlist items is not found");\r
+ assert_own_property(items[0], "content", "items does not own content property.");\r
+ assert_type(items[0].content, "object", "content should be an object");\r
+ items[0].content = null;\r
+ assert_not_equals(items[0].content, null, "content should not be modified");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ assert_greater_than(contents.length, 0, "length should greater than 0");\r
+ gPlaylist.add(contents[0]);\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>PlaylistItem_extend</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: PlaylistItem_extend\r
+//==== LABEL Check if interface PlaylistItem can have new properties\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:PlaylistItem:PlaylistItem U\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P3\r
+//==== TEST_CRITERIA OBX\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ assert_greater_than(items.length, 0 ,"Playlist items is not found");\r
+ check_extensibility(items);\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>PlaylistItem_notexist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: PlaylistItem_notexist\r
+//==== LABEL Check if interface PlaylistItem exists,it should not\r
+//==== SPEC Tizen Web API:Content:Content:PlaylistItem:PlaylistItem U\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P3\r
+//==== TEST_CRITERIA NIO\r
+\r
+test(function () {\r
+ check_no_interface_object("PlaylistItem");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>PlaylistSuccessCallback_notexist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: PlaylistSuccessCallback_notexist\r
+//==== LABEL Check if interface PlaylistSuccessCallback exists,it should not\r
+//==== SPEC Tizen Web API:Content:Content:PlaylistSuccessCallback:PlaylistSuccessCallback U\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P3\r
+//==== TEST_CRITERIA CBNIO\r
+\r
+test(function () {\r
+ check_no_interface_object("PlaylistSuccessCallback");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>PlaylistSuccessCallback_onsuccess</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: PlaylistSuccessCallback_onsuccess\r
+//==== LABEL Check if PlaylistSuccessCallback onsuccess is called and if its arguments have proper type\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:PlaylistSuccessCallback:PlaylistSuccessCallback U\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA CBT CBOA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ onSuccess, onError, removePlaylistSuccess;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ onSuccess = t.step_func(function (playlist) {\r
+ assert_not_equals(playlist , null, "Argument should not be null.");\r
+ assert_type(playlist, "object", "Incorrect type.");\r
+ assert_type(playlist.id, "string", "id type check");\r
+ assert_type(playlist.name, "string", "name type check");\r
+ assert_type(playlist.numberOfTracks, "long", "numberOfTracks type check");\r
+ assert_equals(playlist.thumbnailURI, null, "thumbnailURI type check");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess);\r
+ });\r
+\r
+ onError = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), onSuccess, onError);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_add</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_add\r
+//==== LABEL Check if Playlist add method works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:add M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MR MAST\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist, successCallback, errorCallback, i, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ assert_equals(retVal, undefined, "add should return undefined");\r
+ assert_not_equals(items, 0, "items should not be 0");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ retVal = gPlaylist.add(contents[0]);\r
+ }\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_addBatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_addBatch\r
+//==== LABEL Check if Playlist addBatch method works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:addBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MR MAST MMINA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, removePlaylistSuccess, removePlaylistFail, successCallback, errorCallback, gPlaylist ,retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ assert_equals(retVal, undefined, "addBatch should return undefined");\r
+ assert_not_equals(items, 0, "items should not be 0");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ retVal = gPlaylist.addBatch([contents[0], contents[1]]);\r
+ }\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_addBatch_errorCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_addBatch_errorCallback_TypeMismatch\r
+//==== LABEL Check if Playlist addBatch method throws exception when errorCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:addBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, conversionTable, i, exceptionName,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("addBatch() success callback should not be invoked.");\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ errorCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.addBatch([contents[0], contents[1]], successCallback, errorCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ }\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_addBatch_errorCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_addBatch_errorCallback_invalid_cb\r
+//==== LABEL Check if Playlist addBatch method throws exception when errorCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:addBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, incorrectCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onerror: function (error) {\r
+ assert_unreached("Invalid errorCallback invoked:" + error.name + " msg: " + error.message);\r
+ }\r
+ };\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("addBatch() success callback should not be invoked.");\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ gPlaylist.addBatch([contents[0], contents[1]], successCallback, incorrectCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_addBatch_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_addBatch_exist\r
+//==== LABEL Check if addBatch exists\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:addBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_true("addBatch" in playlist, "Playlist should have addBatch method");\r
+ check_method_exists(playlist, "addBatch");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_addBatch_items_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_addBatch_items_TypeMismatch\r
+//==== LABEL Check if addBatch throws exception when content is incorrect\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:addBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, conversionTable, item, i, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ conversionTable = getTypeConversionExceptions("object", false);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ item = conversionTable[i][0];\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ playlist.addBatch(item);\r
+ }, "Invoked with non-optional arguments.");\r
+ }\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_addBatch_misarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_addBatch_misarg\r
+//==== LABEL Check if addBatch method called with missing non-optional argument throws an exception\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:addBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ playlist.addBatch();\r
+ }, "Invoked with non-optional arguments.");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_addBatch_successCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_addBatch_successCallback_TypeMismatch\r
+//==== LABEL Check if Playlist addBatch method throws exception when successCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:addBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, conversionTable, i, exceptionName,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ errorCallback = t.step_func(function () {\r
+ assert_unreached("addBatch() error callback should not be invoked.");\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ successCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.addBatch([contents[0], contents[1]], successCallback, errorCallback);\r
+ }, "Given incorrect successCallback.");\r
+ }\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_addBatch_successCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_addBatch_successCallback_invalid_cb\r
+//==== LABEL Check if Playlist addBatch method throws exception when successCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:addBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, incorrectCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function () {\r
+ assert_unreached("Invalid successCallback invoked.");\r
+ }\r
+ };\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ gPlaylist.addBatch([contents[0], contents[1]], incorrectCallback);\r
+ }, "Given incorrect successCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_addBatch_with_errorCallback</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_addBatch_with_errorCallback\r
+//==== LABEL Check if Playlist addBatch method works properly with all optional arguments\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:addBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MOA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function () {\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], successCallback, errorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_add_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_add_exist\r
+//==== LABEL Check if add exists\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:add M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_true("add" in playlist, "Playlist should have add method");\r
+ check_method_exists(playlist, "add");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_add_item_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_add_item_TypeMismatch\r
+//==== LABEL Check if add throws exception when content is incorrect\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:add M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, conversionTable, item, exceptionName, i, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ conversionTable = getTypeConversionExceptions("object", false);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ item = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ playlist.add(item);\r
+ }, "Invoked with non-optional arguments.");\r
+ }\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_add_misarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_add_misarg\r
+//==== LABEL Check if add method called with missing non-optional argument throws an exception\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:add M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ playlist.add();\r
+ }, "Invoked with non-optional arguments.");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_extend</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_extend\r
+//==== LABEL Check if interface Playlist can have new properties\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:Playlist U\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P3\r
+//==== TEST_CRITERIA OBX\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}), createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ check_extensibility(playlist);\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_get</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_get\r
+//==== LABEL Check if Playlist get method works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:get M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MR MMINA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ assert_equals(retVal, undefined, "get should return undefined");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ retVal = gPlaylist.get(successCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_get_errorCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_get_errorCallback_TypeMismatch\r
+//==== LABEL Check if Playlist get method throws exception when errorCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:get M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, conversionTable, i, exceptionName,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("get() success callback should not be invoked.");\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ errorCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_get_errorCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_get_errorCallback_invalid_cb\r
+//==== LABEL Check if Playlist get method throws exception when errorCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:get M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, incorrectCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onerror: t.step_func(function (error) {\r
+ assert_unreached("Invalid errorCallback invoked:" + error.name + " msg: " + error.message);\r
+ })\r
+ };\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("get() success callback should not be invoked.");\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ gPlaylist.get(successCallback, incorrectCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_get_errorCallback_invoked</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_get_errorCallback_invoked\r
+//==== LABEL Check if Playlist get method with invalid arguments would invoke errorCallback\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:get M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MERRCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, count = 1, offset = -1,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ assert_unreached("get() success callback unreachable");\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_equals(error.name, "InvalidValuesError", "Incorrect error name");\r
+ assert_type(error.message, "string", "Error message is not a string");\r
+ assert_not_equals(error.message, "","Error message is empty");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ gPlaylist.get(successCallback, errorCallback, count, offset);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_get_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_get_exist\r
+//==== LABEL Check if get exists\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:get M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_true("get" in playlist, "Playlist should have get method");\r
+ check_method_exists(playlist, "get");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_get_misarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_get_misarg\r
+//==== LABEL Check if get method called with missing non-optional argument throws an exception\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:get M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ gPlaylist.get();\r
+ }, "Invoked with non-optional arguments.");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_get_successCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_get_successCallback_TypeMismatch\r
+//==== LABEL Check if Playlist get method throws exception when successCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:get M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, conversionTable, i, exceptionName,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback should not be invoked.");\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ successCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ }, "Given incorrect successCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_get_successCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_get_successCallback_invalid_cb\r
+//==== LABEL Check if Playlist get method throws exception when successCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:get M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, incorrectCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function (items) {\r
+ assert_unreached("Invalid successCallback invoked.");\r
+ }\r
+ };\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION,\r
+ function () {\r
+ gPlaylist.get(incorrectCallback);\r
+ }, "Given incorrect successCallback.");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_get_with_offset</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_get_with_offset\r
+//==== LABEL Check if Playlist get method works properly with all optional arguments\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:get M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MOA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, count = 1, offset = 1,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ gPlaylist.get(successCallback, errorCallback, count, offset);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_id_attribute</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_id_attribute\r
+//==== LABEL Check if Playlist have id attribute with proper type and is readonly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:id A\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA AE AT ARO\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_own_property(playlist, "id", "playlist does not own id property.");\r
+ assert_type(playlist.id, "string", "id should be an string");\r
+ check_readonly(playlist, "id", playlist.id, "string", playlist.id + "abc");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move\r
+//==== LABEL Check if Playlist move method works properly without optional arguments\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MR MMINA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, addsuccessCallback, adderrorCallback,\r
+ moveSuccess, removePlaylistSuccess, removePlaylistFail, gPlaylist, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ moveSuccess = t.step_func(function () {\r
+ assert_equals(retVal, undefined, "move should return undefined");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ retVal = gPlaylist.move(items[1], -1, moveSuccess);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move_errorCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move_errorCallback_TypeMismatch\r
+//==== LABEL Check if Playlist move method throws exception when errorCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, addsuccessCallback, adderrorCallback,\r
+ moveSuccess, moveFail, removePlaylistSuccess, removePlaylistFail, gPlaylist, conversionTable, i, exceptionName;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ moveSuccess = t.step_func(function () {\r
+ assert_unreached("move() success callback should not be invoked.");\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ moveFail = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.move(items[1], -1, moveSuccess, moveFail);\r
+ }, "Given incorrect errorCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move_errorCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move_errorCallback_invalid_cb\r
+//==== LABEL Check if Playlist move method throws exception when errorCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, addsuccessCallback, adderrorCallback,\r
+ moveSuccess, incorrectCallback, removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ moveSuccess = t.step_func(function () {\r
+ assert_unreached("move() success callback should not be invoked.");\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function (error) {\r
+ assert_unreached("Invalid errorCallback invoked:" + error.name + " msg: " + error.message);\r
+ }\r
+ };\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION,\r
+ function () {\r
+ gPlaylist.move(items[1], -1, moveSuccess, incorrectCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move_errorCallback_invoked</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move_errorCallback_invoked\r
+//==== LABEL Check if Playlist move method with invalid arguments would invoke errorCallback\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MERRCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, addsuccessCallback, adderrorCallback,\r
+ moveSuccess, moveFail, removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ moveSuccess = t.step_func(function () {\r
+ assert_unreached("move() success callback should not be invoked.");\r
+ });\r
+\r
+ moveFail = t.step_func(function (error) {\r
+ assert_equals(error.name, "InvalidValuesError", "Incorrect error name");\r
+ assert_type(error.message, "string", "Error message is not a string");\r
+ assert_not_equals(error.message, "","Error message is empty");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ gPlaylist.remove(items[0]);\r
+ gPlaylist.move(items[0], items.length, moveSuccess, moveFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ assert_greater_than(contents.length, 2, "length should greater than 2");\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move_exist\r
+//==== LABEL Check if move exists\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_true("move" in playlist, "Playlist should have move method");\r
+ check_method_exists(playlist, "move");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move_item_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move_item_TypeMismatch\r
+//==== LABEL Check if Playlist move method throws exception when item is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, addsuccessCallback, adderrorCallback,\r
+ moveSuccess, moveFail, removePlaylistSuccess, removePlaylistFail, gPlaylist, conversionTable, i, exceptionName;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ moveSuccess = t.step_func(function () {\r
+ assert_unreached("move() success callback should not be invoked.");\r
+ });\r
+\r
+ moveFail = t.step_func(function (error) {\r
+ assert_unreached("move() error callback should not be invoked.");\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ conversionTable = getTypeConversionExceptions("object", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ items = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.move(items, -1, moveSuccess, moveFail);\r
+ }, "Given incorrect errorCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move_noarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move_noarg\r
+//==== LABEL Check if move method called with missing non-optional argument throws an exception\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, addsuccessCallback, adderrorCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ gPlaylist.move();\r
+ }, "miss argument");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move_successCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move_successCallback_TypeMismatch\r
+//==== LABEL Check if Playlist move method throws exception when successCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, addsuccessCallback, adderrorCallback,\r
+ moveSuccess, moveFail, removePlaylistSuccess, removePlaylistFail, gPlaylist, conversionTable, i, exceptionName;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ moveFail = t.step_func(function (error) {\r
+ assert_unreached("move() error callback should not be invoked.");\r
+ });\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ moveSuccess = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.move(items[1], -1, moveSuccess, moveFail);\r
+ }, "Given incorrect errorCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move_successCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move_successCallback_invalid_cb\r
+//==== LABEL Check if Playlist move method throws exception when successCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, successCallback, errorCallback, addsuccessCallback, adderrorCallback,\r
+ moveFail, incorrectCallback, removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ moveFail = t.step_func(function (error) {\r
+ assert_unreached("move() error callback should not be invoked.");\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function (error) {\r
+ assert_unreached("Invalid errorCallback invoked:" + error.name + " msg: " + error.message);\r
+ }\r
+ };\r
+\r
+ successCallback = t.step_func(function (items) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION,\r
+ function () {\r
+ gPlaylist.move(items[1], -1, incorrectCallback, moveFail);\r
+ }, "Given incorrect errorCallback.");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(successCallback, errorCallback);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_move_with_errorCallback</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_move_with_errorCallback\r
+//==== LABEL Check if Playlist move method works properly with all optional arguments\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:move M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MOA MAST\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addsuccessCallback, adderrorCallback,\r
+ moveSuccess, moveFail, removePlaylistSuccess, removePlaylistFail, gPlaylist, gItmes, get2successCallback, get2errorCallback;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ get2successCallback = t.step_func(function (items) {\r
+ assert_equals(items[0].content.id, gItmes[1].content.id, "after moving items[0] should be the same with gItmes[1]");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ get2errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback (after move)was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ moveSuccess = t.step_func(function () {\r
+ gPlaylist.get(get2successCallback, get2errorCallback);\r
+ });\r
+\r
+ moveFail = t.step_func(function (error) {\r
+ assert_unreached("move() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ gItmes = items;\r
+ gPlaylist.move(items[1], -1, moveSuccess, moveFail);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ assert_greater_than(contents.length, 2, "length should greater than 2");\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_name_attribute</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_name_attribute\r
+//==== LABEL Check if Playlist have name attribute with proper type\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:name A\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA AE AT ASG AN\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_own_property(playlist, "name", "playlist does not own name property.");\r
+ assert_type(playlist.name, "string", "name should be an string");\r
+ check_attribute(playlist, "name", playlist.name, "string", playlist.name + "abc");\r
+ check_not_nullable(playlist, "name");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_notexist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_notexist\r
+//==== LABEL Check if interface Playlist exists, it should not\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:Playlist U\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P3\r
+//==== TEST_CRITERIA NIO\r
+\r
+test(function () {\r
+ check_no_interface_object("Playlist");\r
+}, document.title);\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_numberOfTracks_attribute</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_numberOfTracks_attribute\r
+//==== LABEL Check if Playlist have numberOfTracks attribute with proper type and is readonly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:numberOfTracks A\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA AE AT ARO\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_own_property(playlist, "numberOfTracks", "playlist does not own numberOfTracks property.");\r
+ assert_type(playlist.numberOfTracks, "long", "numberOfTracks should be an long");\r
+ check_readonly(playlist, "numberOfTracks", playlist.numberOfTracks, "long", playlist.numberOfTracks + 1);\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_remove</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_remove\r
+//==== LABEL Check if Playlist remove method works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:remove M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MR MAST\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getSuccess, getFail, get2Success, get2Fail,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist, beforelenght, afterlength, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ get2Success = t.step_func(function (items) {\r
+ assert_equals(retVal, undefined, "remove should return undefined");\r
+ afterlength = items.length;\r
+ assert_less_than(afterlength, beforelenght, "length should be decrease");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ get2Fail = t.step_func(function (error) {\r
+ assert_unreached("get() error callback(after remove) was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ getSuccess = t.step_func(function (items) {\r
+ beforelenght = items.length;\r
+ retVal = gPlaylist.remove(items[0]);\r
+ gPlaylist.get(get2Success, get2Fail);\r
+ });\r
+\r
+ getFail = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 0) {\r
+ gPlaylist.add(contents[0]);\r
+ gPlaylist.get(getSuccess, getFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_removeBatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_removeBatch\r
+//==== LABEL Check if Playlist removeBatch method works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:removeBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MR MAST MMINA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getSuccess, getFail, get2Success, get2Fail, addsuccessCallback, adderrorCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist , afterlength, beforelenght, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ get2Success = t.step_func(function (items) {\r
+ assert_equals(retVal, undefined, "remove should return undefined");\r
+ afterlength = items.length;\r
+ assert_equals(afterlength, 0, "length should be zero")\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ get2Fail = t.step_func(function (error) {\r
+ assert_unreached("get() error callback(after removeBatch) was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ getSuccess = t.step_func(function (items) {\r
+ beforelenght = items.length;\r
+ retVal = gPlaylist.removeBatch([items[0], items[1]]);\r
+ setTimeout(function(){gPlaylist.get(get2Success, get2Fail);}, 1000);\r
+ });\r
+\r
+ getFail = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(getSuccess, getFail);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ assert_greater_than(contents.length, 2, "length should greater than 2");\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_removeBatch_errorCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_removeBatch_errorCallback_TypeMismatch\r
+//==== LABEL Check if Playlist removeBatch method throws exception when errorCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:removeBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, addsuccessCallback, adderrorCallback, successCallback, errorCallback,\r
+ removePlaylistSuccess, removePlaylistFail, getSuccess, getFail, gPlaylist, conversionTable, i, exceptionName;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("removeBatch() success callback should not be invoked.");\r
+ });\r
+\r
+ getSuccess = t.step_func(function (items) {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ errorCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.removeBatch([items[0], items[1]], successCallback, errorCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ getFail = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(getSuccess, getFail);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_removeBatch_errorCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_removeBatch_errorCallback_invalid_cb\r
+//==== LABEL Check if Playlist removeBatch method throws exception when errorCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:removeBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, addsuccessCallback, adderrorCallback, successCallback, incorrectCallback,\r
+ removePlaylistSuccess, removePlaylistFail, getSuccess, getFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onerror: t.step_func(function (error) {\r
+ assert_unreached("Invalid errorCallback invoked:" + error.name + " msg: " + error.message);\r
+ })\r
+ };\r
+\r
+ successCallback = t.step_func(function () {\r
+ assert_unreached("removeBatch() success callback should not be invoked.");\r
+ });\r
+\r
+ getSuccess = t.step_func(function (items) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ gPlaylist.removeBatch([items[0], items[1]], successCallback, incorrectCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ getFail = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(getSuccess, getFail);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_removeBatch_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_removeBatch_exist\r
+//==== LABEL Check if removeBatch exists\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:removeBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_true("removeBatch" in playlist, "Playlist should have removeBatch method");\r
+ check_method_exists(playlist, "removeBatch");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_removeBatch_items_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_removeBatch_items_TypeMismatch\r
+//==== LABEL Check if removeBatch throws exception when content is incorrect\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:removeBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, conversionTable, item, exceptionName, i, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ conversionTable = getTypeConversionExceptions("object", false);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ item = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ playlist.removeBatch(item);\r
+ }, "Invoked with non-optional arguments.");\r
+ }\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_removeBatch_noarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_removeBatch_noarg\r
+//==== LABEL Check if removeBatch method called with missing non-optional argument throws an exception\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:removeBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ playlist.removeBatch();\r
+ }, "Invoked with non-optional arguments.");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_removeBatch_successCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_removeBatch_successCallback_TypeMismatch\r
+//==== LABEL Check if Playlist removeBatch method throws exception when successCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:removeBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, addsuccessCallback, adderrorCallback, successCallback, errorCallback,\r
+ removePlaylistSuccess, removePlaylistFail, getSuccess, getFail, gPlaylist, conversionTable, i, exceptionName;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ errorCallback = t.step_func(function () {\r
+ assert_unreached("removeBatch() success callback should not be invoked.");\r
+ });\r
+\r
+ getSuccess = t.step_func(function (items) {\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ successCallback = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.removeBatch([items[0], items[1]], successCallback, errorCallback);\r
+ }, "Given incorrect successCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ getFail = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(getSuccess, getFail);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_removeBatch_successCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_removeBatch_successCallback_invalid_cb\r
+//==== LABEL Check if Playlist removeBatch method throws exception when successCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:removeBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, addsuccessCallback, adderrorCallback, errorCallback, incorrectCallback,\r
+ removePlaylistSuccess, removePlaylistFail, getSuccess, getFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function () {\r
+ assert_unreached("Invalid successCallback invoked:" + error.name + " msg: " + error.message);\r
+ }\r
+ };\r
+\r
+ errorCallback = t.step_func(function () {\r
+ assert_unreached("removeBatch() error callback should not be invoked.");\r
+ });\r
+\r
+ getSuccess = t.step_func(function (items) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ gPlaylist.removeBatch([items[0], items[1]], incorrectCallback, errorCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ getFail = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(getSuccess, getFail);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_removeBatch_with_errorCallback</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_removeBatch_with_errorCallback\r
+//==== LABEL Check if Playlist removeBatch method works properly with all optional arguments\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:removeBatch M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MOA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, addsuccessCallback, adderrorCallback, getSuccess, getFail, successCallback, errorCallback,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ successCallback = t.step_func(function () {\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ errorCallback = t.step_func(function (error) {\r
+ assert_unreached("removeBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ getSuccess = t.step_func(function (items) {\r
+ gPlaylist.removeBatch([items[0], items[1]], successCallback, errorCallback);\r
+ });\r
+\r
+ getFail = t.step_func(function (error) {\r
+ assert_unreached("get() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ addsuccessCallback = t.step_func(function () {\r
+ gPlaylist.get(getSuccess, getFail);\r
+ });\r
+\r
+ adderrorCallback = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addsuccessCallback, adderrorCallback);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Authors:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_remove_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_remove_exist\r
+//==== LABEL Check if remove exists\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:remove M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_true("remove" in playlist, "Playlist should have remove method");\r
+ check_method_exists(playlist, "remove");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_remove_item_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_remove_item_TypeMismatch\r
+//==== LABEL Check if remove throws exception when item is incorrect\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:remove M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, conversionTable, item, exceptionName, i, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ conversionTable = getTypeConversionExceptions("object", false);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ item = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ playlist.remove(item);\r
+ }, "Invoked with non-optional arguments.");\r
+ }\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_remove_noarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_remove_noarg\r
+//==== LABEL Check if remove method called with missing non-optional argument throws an exception\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:remove M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ playlist.remove();\r
+ }, "Invoked with non-optional arguments.");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder\r
+//==== LABEL Check if Playlist setOrder method works properly\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MR MMINA MAST\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addSuccess, addFail,\r
+ setOrderSuccess, get2successCallback, get2errorCallback, removePlaylistSuccess, removePlaylistFail, gPlaylist, gItems, gExpectedOrder, retVal = null;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ get2successCallback = t.step_func(function (items) {\r
+ assert_equals(items[0].content.name, gItems[items.length-1].content.name, "name should be the same");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ get2errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable(after set order)");\r
+ });\r
+\r
+ setOrderSuccess = t.step_func(function () {\r
+ assert_equals(retVal, undefined, "setOrder should return undefined");\r
+ gPlaylist.get(get2successCallback, get2errorCallback);\r
+ });\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ gItems = items;\r
+ gExpectedOrder = gItems.slice(0);\r
+ gExpectedOrder.reverse();\r
+ retVal = gPlaylist.setOrder(gExpectedOrder, setOrderSuccess);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ addSuccess = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ addFail = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addSuccess, addFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder_errorCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder_errorCallback_TypeMismatch\r
+//==== LABEL Check if Playlist get method throws exception when errorCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addSuccess, addFail, conversionTable, i, exceptionName,\r
+ setOrderSuccess, setOrderFail, removePlaylistSuccess, removePlaylistFail, gPlaylist, gItems, gExpectedOrder;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ setOrderSuccess = t.step_func(function () {\r
+ assert_unreached("setOrder() success callback unreachable");\r
+ });\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ gItems = items;\r
+ gExpectedOrder = gItems.slice(0);\r
+ gExpectedOrder.reverse();\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ setOrderFail = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.setOrder(gExpectedOrder, setOrderSuccess, setOrderFail);\r
+ }, "Given incorrect errorCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ addSuccess = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ addFail = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addSuccess, addFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder_errorCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder_errorCallback_invalid_cb\r
+//==== LABEL Check if Playlist get method throws exception when errorCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addSuccess, addFail, conversionTable,\r
+ setOrderSuccess, incorrectCallback, removePlaylistSuccess, removePlaylistFail, gPlaylist, gItems, gExpectedOrder, i, j;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ setOrderSuccess = t.step_func(function () {\r
+ assert_unreached("setOrder() success callback unreachable");\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function (error) {\r
+ assert_unreached("Invalid errorCallback invoked:" + error.name + " msg: " + error.message);\r
+ }\r
+ };\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ gItems = items;\r
+ gExpectedOrder = gItems.slice(0);\r
+ gExpectedOrder.reverse();\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ gPlaylist.setOrder(gExpectedOrder, setOrderSuccess, incorrectCallback);\r
+ }, "Given incorrect errorCallback.");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ addSuccess = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ addFail = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addSuccess, addFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder_errorCallback_invoked</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder_errorCallback_invoked\r
+//==== LABEL Check if ContentManager setOrder method with invalid arguments would invoke errorCallback\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MERRCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addSuccess, addFail,\r
+ setOrderSuccess, setOrderFail, removePlaylistSuccess, removePlaylistFail, gPlaylist, gExpectedOrder;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ setOrderSuccess = t.step_func(function () {\r
+ assert_unreached("setOrder() success callback unreachable(after set order)");\r
+ });\r
+\r
+ setOrderFail = t.step_func(function (error) {\r
+ assert_equals(error.name, "InvalidValuesError", "Incorrect error name");\r
+ assert_type(error.message, "string", "Error message is not a string");\r
+ assert_not_equals(error.message, "","Error message is empty");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ gExpectedOrder = items.slice(items.length);\r
+ gExpectedOrder.reverse();\r
+ gPlaylist.setOrder(gExpectedOrder, setOrderSuccess, setOrderFail);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ addSuccess = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ addFail = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addSuccess, addFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder_exist</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder_exist\r
+//==== LABEL Check if setOrder exists\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P0\r
+//==== TEST_CRITERIA ME\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_true("setOrder" in playlist, "Playlist should have setOrder method");\r
+ check_method_exists(playlist, "setOrder");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder_items_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder_items_TypeMismatch\r
+//==== LABEL Check if Playlist get method throws exception when items is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addSuccess, addFail, conversionTable, i, exceptionName,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ conversionTable = getTypeConversionExceptions("array", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ items = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.setOrder(items);\r
+ }, "Given incorrect items.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ addSuccess = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ addFail = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addSuccess, addFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder_noarg</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder_noarg\r
+//==== LABEL Check if setOrder method called with missing non-optional argument throws an exception\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MMA\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addSuccess, addFail,\r
+ removePlaylistSuccess, removePlaylistFail, gPlaylist, gItems, gExpectedOrder;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ gItems = items;\r
+ gExpectedOrder = gItems.slice(0);\r
+ gExpectedOrder.reverse();\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION,\r
+ function () {\r
+ gPlaylist.setOrder();\r
+ }, "missing non-optional argument should throw an exception");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ addSuccess = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ addFail = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addSuccess, addFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder_successCallback_TypeMismatch</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder_successCallback_TypeMismatch\r
+//==== LABEL Check if Playlist get method throws exception when successCallback is incorrect\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MC\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addSuccess, addFail, conversionTable, i, exceptionName,\r
+ setOrderSuccess, removePlaylistSuccess, removePlaylistFail, gPlaylist, gItems, gExpectedOrder;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ gItems = items;\r
+ gExpectedOrder = gItems.slice(0);\r
+ gExpectedOrder.reverse();\r
+ conversionTable = getTypeConversionExceptions("functionObject", true);\r
+ for (i = 0; i < conversionTable.length; i++) {\r
+ setOrderSuccess = conversionTable[i][0];\r
+ exceptionName = conversionTable[i][1];\r
+ assert_throws({name: exceptionName},\r
+ function () {\r
+ gPlaylist.setOrder(gExpectedOrder, setOrderSuccess);\r
+ }, "Given incorrect errorCallback.");\r
+ }\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ addSuccess = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ addFail = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addSuccess, addFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder_successCallback_invalid_cb</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder_successCallback_invalid_cb\r
+//==== LABEL Check if Playlist get method throws exception when successCallback is invalid\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P2\r
+//==== TEST_CRITERIA MTCB\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addSuccess, addFail,\r
+ incorrectCallback, removePlaylistSuccess, removePlaylistFail, gPlaylist, gItems, gExpectedOrder;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ incorrectCallback = {\r
+ onsuccess: function () {\r
+ assert_unreached("Invalid successCallback invoked.");\r
+ }\r
+ };\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ gItems = items;\r
+ gExpectedOrder = gItems.slice(0);\r
+ gExpectedOrder.reverse();\r
+ assert_throws(TYPE_MISMATCH_EXCEPTION, function () {\r
+ gPlaylist.setOrder(gExpectedOrder, incorrectCallback);\r
+ }, "Given incorrect successCallback.");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ addSuccess = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ addFail = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addSuccess, addFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_setOrder_with_errorCallback</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_setOrder_with_errorCallback\r
+//==== LABEL Check if Playlist setOrder method works properly with all optional arguments\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:setOrder M\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA MOA MAST\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ findSuccess, findFail, createSuccess, createFail, getsuccessCallback, geterrorCallback, addSuccess, addFail,\r
+ setOrderSuccess, setOrderFail, get2successCallback, get2errorCallback, removePlaylistSuccess, removePlaylistFail, gPlaylist, gItems, gExpectedOrder;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ get2successCallback = t.step_func(function (items) {\r
+ assert_equals(items[0].content.name, gItems[items.length-1].content.name, "name should be the same");\r
+ tizen.content.removePlaylist(gPlaylist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ get2errorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable(after set order)");\r
+ });\r
+\r
+ setOrderSuccess = t.step_func(function () {\r
+ gPlaylist.get(get2successCallback, get2errorCallback);\r
+ });\r
+\r
+ setOrderFail = t.step_func(function (error) {\r
+ assert_unreached("setOrder() error callback unreachable");\r
+ });\r
+\r
+ getsuccessCallback = t.step_func(function (items) {\r
+ gItems = items;\r
+ gExpectedOrder = gItems.slice(0);\r
+ gExpectedOrder.reverse();\r
+ gPlaylist.setOrder(gExpectedOrder, setOrderSuccess, setOrderFail);\r
+ });\r
+\r
+ geterrorCallback = t.step_func(function (error) {\r
+ assert_unreached("get() error callback unreachable");\r
+ });\r
+\r
+ addSuccess = t.step_func(function () {\r
+ gPlaylist.get(getsuccessCallback, geterrorCallback);\r
+ });\r
+\r
+ addFail = t.step_func(function (error) {\r
+ assert_unreached("addBatch() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ findSuccess = t.step_func(function (contents) {\r
+ if (contents.length > 2) {\r
+ gPlaylist.addBatch([contents[0], contents[1]], addSuccess, addFail);\r
+ }\r
+ });\r
+\r
+ findFail = t.step_func(function (error) {\r
+ assert_unreached("find() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ gPlaylist = playlist;\r
+ tizen.content.find(findSuccess, findFail, null, new tizen.AttributeFilter("type", "EXACTLY", "AUDIO"));\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html>\r
+<!--\r
+Copyright (c) 2014 Samsung Electronics Co., Ltd.\r
+\r
+Licensed under the Apache License, Version 2.0 (the License);\r
+you may not use this file except in compliance with the License.\r
+You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+Unless required by applicable law or agreed to in writing, software\r
+distributed under the License is distributed on an "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+See the License for the specific language governing permissions and\r
+limitations under the License.\r
+\r
+Author:\r
+ Xiaoyan Qian <xy.qian@samsung.com>\r
+\r
+-->\r
+<html>\r
+<head>\r
+<title>Playlist_thumbnailURI_attribute</title>\r
+<meta charset="utf-8"/>\r
+<script src="support/unitcommon.js"></script>\r
+<script src="support/content_common.js"></script>\r
+</head>\r
+<body>\r
+<div id="log"></div>\r
+<script>\r
+//==== TEST: Playlist_thumbnailURI_attribute\r
+//==== LABEL Check if Playlist have thumbnailURI attribute with proper type\r
+//==== ONLOAD_DELAY 30\r
+//==== SPEC Tizen Web API:Content:Content:Playlist:thumbnailURI A\r
+//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/content.html\r
+//==== PRIORITY P1\r
+//==== TEST_CRITERIA AE AT ASG ADV\r
+\r
+setup({timeout: 30000});\r
+\r
+var t = async_test(document.title, {timeout: 30000}),\r
+ createSuccess, createFail, removePlaylistSuccess, removePlaylistFail;\r
+\r
+t.step(function () {\r
+ removePlaylistSuccess = t.step_func(function () {\r
+ t.done();\r
+ });\r
+\r
+ removePlaylistFail = t.step_func(function (error) {\r
+ assert_unreached("removePlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ createSuccess = t.step_func(function (playlist) {\r
+ assert_own_property(playlist, "thumbnailURI", "playlist does not own thumbnailURI property.");\r
+ assert_equals(playlist.thumbnailURI, null, "playlist.thumbnailURI should be null by default.");\r
+ tizen.content.removePlaylist(playlist.id, removePlaylistSuccess, removePlaylistFail);\r
+ });\r
+\r
+ createFail = t.step_func(function (error) {\r
+ assert_unreached("createPlaylist() error callback was invoked: " + error.name + " msg: " + error.message);\r
+ });\r
+\r
+ tizen.content.createPlaylist(randomString(5), createSuccess, createFail);\r
+});\r
+\r
+</script>\r
+</body>\r
+</html>
\ No newline at end of file