From: Tomasz Kusmierz Date: Tue, 8 Oct 2013 10:54:25 +0000 (+0200) Subject: [Push] Various fixes. X-Git-Tag: 2.2.1_release~105^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a576de83991d124ba45156b020f59d6e84bce552;p=test%2Ftct%2Fweb%2Fapi.git [Push] Various fixes. Change-Id: I45cf49113227bfbc01d683f1e61eb06e1ae48127 --- diff --git a/tct-push-tizen-tests/push/PushManagerObject_notexist.html b/tct-push-tizen-tests/push/PushManagerObject_notexist.html index de8778a8e..846a52260 100644 --- a/tct-push-tizen-tests/push/PushManagerObject_notexist.html +++ b/tct-push-tizen-tests/push/PushManagerObject_notexist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManagerObject_notexist - + @@ -37,7 +37,8 @@ Authors: //==== TEST_CRITERIA NIO test(function () { check_no_interface_object("PushManagerObject"); -}, "PushManagerObject_notexist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_connectService.html b/tct-push-tizen-tests/push/PushManager_connectService.html index f48e8dda0..fbf944675 100644 --- a/tct-push-tizen-tests/push/PushManager_connectService.html +++ b/tct-push-tizen-tests/push/PushManager_connectService.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_connectService - + @@ -33,12 +33,12 @@ Authors: //==== TEST: PushManager_connectService //==== LABEL Check if connectService method works correctly //==== SPEC Tizen Web API:TBD:Push:PushManager:connectService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== ONLOAD_DELAY 90 //==== TEST_CRITERIA MMINA MR setup({timeout: 90000}); -var t = async_test("PushManager_connectService", {timeout:90000}), +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, pushRegisterErrorCallback, unregisterServiceError, unregisterServiceDone, notificationCallback, returnedValue = null; @@ -48,7 +48,7 @@ t.step(function () { }); unregisterServiceError = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); notificationCallback = t.step_func(function (message) { @@ -65,11 +65,12 @@ t.step(function () { }); pushRegisterErrorCallback = t.step_func(function (error) { - assert_unreached("registerService() error occurred: " + error.name + " :" + error.message); + assert_unreached("registerService() error occurred: " + error.name + ":" + error.message); }); tizen.push.registerService(service, pushRegisterSuccessCallback, pushRegisterErrorCallback); }); + diff --git a/tct-push-tizen-tests/push/PushManager_connectService_exist.html b/tct-push-tizen-tests/push/PushManager_connectService_exist.html index a0ce74ec3..8dbe8cec0 100644 --- a/tct-push-tizen-tests/push/PushManager_connectService_exist.html +++ b/tct-push-tizen-tests/push/PushManager_connectService_exist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_connectService_exist - + @@ -37,7 +37,8 @@ Authors: test(function () { assert_true("connectService" in tizen.push, "No connectService method in tizen.push"); check_method_exists(tizen.push, "connectService"); -}, "PushManager_connectService_exist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_connectService_missarg.html b/tct-push-tizen-tests/push/PushManager_connectService_missarg.html index c0145c0eb..c00bf5cae 100644 --- a/tct-push-tizen-tests/push/PushManager_connectService_missarg.html +++ b/tct-push-tizen-tests/push/PushManager_connectService_missarg.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_connectService_missarg - + @@ -33,12 +33,12 @@ Authors: //==== TEST: PushManager_connectService_missarg //==== LABEL Check with missing non-optional argument - connectService method //==== SPEC Tizen Web API:TBD:Push:PushManager:connectService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== ONLOAD_DELAY 90 //==== TEST_CRITERIA MMA setup({timeout: 90000}); -var t = async_test("PushManager_connectService_missarg", {timeout:90000}), pushRegisterSuccessCallback, +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, pushRegisterErrorCallback, unregisterServiceDone, unregisterServiceError, exceptionName = "TypeMismatchError"; t.step(function () { @@ -47,12 +47,12 @@ t.step(function () { }); unregisterServiceError = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); pushRegisterSuccessCallback = t.step_func(function (registrationId) { try { - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.connectService(); }, exceptionName + " should be thrown - missing argument"); @@ -64,11 +64,12 @@ t.step(function () { }); pushRegisterErrorCallback = t.step_func(function (error) { - assert_unreached("registerService() error occurred: " + error.name + " :" + error.message); + assert_unreached("registerService() error occurred: " + error.name + ":" + error.message); }); tizen.push.registerService(service, pushRegisterSuccessCallback, pushRegisterErrorCallback); }); + diff --git a/tct-push-tizen-tests/push/PushManager_connectService_notificationCallback_TypeMismatch.html b/tct-push-tizen-tests/push/PushManager_connectService_notificationCallback_TypeMismatch.html index 0c4a620a2..52a6b3a7b 100644 --- a/tct-push-tizen-tests/push/PushManager_connectService_notificationCallback_TypeMismatch.html +++ b/tct-push-tizen-tests/push/PushManager_connectService_notificationCallback_TypeMismatch.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_connectService_notificationCallback_TypeMismatch - + @@ -33,9 +33,9 @@ Authors: //==== LABEL Check if connectService throws exception when successCallback is incorrect //==== PRIORITY: P2 //==== SPEC Tizen Web API:TBD:Push:PushManager:connectService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA MC -test(function() { +test(function () { var conversionTable, incorrectCallback, exceptionName, i; conversionTable = getTypeConversionExceptions("functionObject", false); @@ -43,12 +43,13 @@ test(function() { incorrectCallback = conversionTable[i][0]; exceptionName = conversionTable[i][1]; - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.connectService(incorrectCallback); }, exceptionName + " should be thrown - given incorrect success callback - " + incorrectCallback); } -}, "PushManager_connectService_notificationCallback_TypeMismatch"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_connectService_notificationCallback_invalid_cb.html b/tct-push-tizen-tests/push/PushManager_connectService_notificationCallback_invalid_cb.html index b57a1b43f..fa86cb12b 100644 --- a/tct-push-tizen-tests/push/PushManager_connectService_notificationCallback_invalid_cb.html +++ b/tct-push-tizen-tests/push/PushManager_connectService_notificationCallback_invalid_cb.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_connectService_notificationCallback_invalid_cb - + @@ -34,11 +34,11 @@ Authors: //==== PRIORITY: P2 //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:TBD:Push:PushManager:connectService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA MTCB setup({timeout: 90000}); -var t = async_test("PushManager_connectService_notificationCallback_invalid_cb", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), incorrectCallback, exceptionName = "TypeMismatchError"; t.step(function () { @@ -48,13 +48,14 @@ t.step(function () { }) }; - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.connectService(incorrectCallback); }, exceptionName + " should be thrown - given incorrect success callback - " + incorrectCallback); t.done(); }); + diff --git a/tct-push-tizen-tests/push/PushManager_disconnectService.html b/tct-push-tizen-tests/push/PushManager_disconnectService.html index e5ba26cac..f123042b1 100644 --- a/tct-push-tizen-tests/push/PushManager_disconnectService.html +++ b/tct-push-tizen-tests/push/PushManager_disconnectService.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_disconnectService - + @@ -33,12 +33,12 @@ Authors: //==== TEST: PushManager_disconnectService //==== LABEL Check if disconnectService method works correctly //==== SPEC Tizen Web API:TBD:Push:PushManager:disconnectService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== ONLOAD_DELAY 90 //==== TEST_CRITERIA MNA MR setup({timeout: 90000}); -var t = async_test("PushManager_disconnectService", {timeout:90000}), pushRegisterSuccessCallback, +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, unregisterServiceDone, unregisterServiceError, notificationCallback, returnedValue = null, pushRegisterErrorCallback; @@ -48,7 +48,7 @@ t.step(function () { }); unregisterServiceError = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); notificationCallback = t.step_func(function (message) { @@ -65,11 +65,12 @@ t.step(function () { }); pushRegisterErrorCallback = t.step_func(function (error) { - assert_unreached("registerService() error occurred: " + error.name + " :" + error.message); + assert_unreached("registerService() error occurred: " + error.name + ":" + error.message); }); tizen.push.registerService(service, pushRegisterSuccessCallback, pushRegisterErrorCallback); }); + diff --git a/tct-push-tizen-tests/push/PushManager_disconnectService_exist.html b/tct-push-tizen-tests/push/PushManager_disconnectService_exist.html index fc22d4a4a..b49bc01d8 100644 --- a/tct-push-tizen-tests/push/PushManager_disconnectService_exist.html +++ b/tct-push-tizen-tests/push/PushManager_disconnectService_exist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_disconnectService_exist - + @@ -37,7 +37,8 @@ Authors: test(function () { assert_true("disconnectService" in tizen.push, "No disconnectService method in tizen.push"); check_method_exists(tizen.push, "disconnectService"); -}, "PushManager_disconnectService_exist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_disconnectService_extra_argument.html b/tct-push-tizen-tests/push/PushManager_disconnectService_extra_argument.html index 4113401ce..648b403a7 100644 --- a/tct-push-tizen-tests/push/PushManager_disconnectService_extra_argument.html +++ b/tct-push-tizen-tests/push/PushManager_disconnectService_extra_argument.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_disconnectService_extra_argument - + @@ -36,7 +36,8 @@ Authors: //==== TEST_CRITERIA MNAEX test(function () { checkExtraArgument(tizen.push, "disconnectService"); -}, "PushManager_disconnectService_extra_argument"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_extend.html b/tct-push-tizen-tests/push/PushManager_extend.html index 23d6b84d8..369f5b76c 100644 --- a/tct-push-tizen-tests/push/PushManager_extend.html +++ b/tct-push-tizen-tests/push/PushManager_extend.html @@ -15,28 +15,29 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - PushManager_extend - +PushManager_extend +
diff --git a/tct-push-tizen-tests/push/PushManager_getRegistrationId.html b/tct-push-tizen-tests/push/PushManager_getRegistrationId.html index b4954a62f..79ce2d3b0 100644 --- a/tct-push-tizen-tests/push/PushManager_getRegistrationId.html +++ b/tct-push-tizen-tests/push/PushManager_getRegistrationId.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_getRegistrationId - + @@ -33,12 +33,12 @@ Authors: //==== TEST: PushManager_getRegistrationId //==== LABEL Check if method getRegistrationId of PushManager works correctly //==== SPEC Tizen Web API:TBD:Push:PushManager:getRegistrationId M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== ONLOAD_DELAY 90 //==== TEST_CRITERIA MNA MR setup({timeout: 90000}); -var t = async_test("PushManager_getRegistrationId", {timeout:90000}), +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, pushRegisterErrorCallback, registrationIdFromMethod, unregisterServiceDone, unregisterServiceError; @@ -48,7 +48,7 @@ t.step(function () { }); unregisterServiceError = t.step_func(function (error) { - assert_unreached("unregisterServiceError() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterServiceError() error occurred: " + error.name + ":" + error.message); }); pushRegisterSuccessCallback = t.step_func(function (registrationIdFromArgument) { @@ -61,11 +61,12 @@ t.step(function () { }); pushRegisterErrorCallback = t.step_func(function (error) { - assert_unreached("registerService() error occurred: " + error.name + " :" + error.message); + assert_unreached("registerService() error occurred: " + error.name + ":" + error.message); }); tizen.push.registerService(service, pushRegisterSuccessCallback, pushRegisterErrorCallback); }); + diff --git a/tct-push-tizen-tests/push/PushManager_getRegistrationId_exist.html b/tct-push-tizen-tests/push/PushManager_getRegistrationId_exist.html index df627c52d..c89a6f95f 100644 --- a/tct-push-tizen-tests/push/PushManager_getRegistrationId_exist.html +++ b/tct-push-tizen-tests/push/PushManager_getRegistrationId_exist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_getRegistrationId_exist - + @@ -37,7 +37,8 @@ Authors: test(function () { assert_true("getRegistrationId" in tizen.push, "No getRegistrationId method in tizen.push"); check_method_exists(tizen.push, "getRegistrationId"); -}, "PushManager_getRegistrationId_exist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_getRegistrationId_extra_argument.html b/tct-push-tizen-tests/push/PushManager_getRegistrationId_extra_argument.html index a670a37b4..6efcabd88 100644 --- a/tct-push-tizen-tests/push/PushManager_getRegistrationId_extra_argument.html +++ b/tct-push-tizen-tests/push/PushManager_getRegistrationId_extra_argument.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_getRegistrationId_extra_argument - + @@ -36,7 +36,8 @@ Authors: //==== TEST_CRITERIA MNAEX test(function () { checkExtraArgument(tizen.push, "getRegistrationId"); -}, "PushManager_getRegistrationId_extra_argument"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_getRegistrationId_notRegistered.html b/tct-push-tizen-tests/push/PushManager_getRegistrationId_notRegistered.html index a303e89fa..c661625e7 100644 --- a/tct-push-tizen-tests/push/PushManager_getRegistrationId_notRegistered.html +++ b/tct-push-tizen-tests/push/PushManager_getRegistrationId_notRegistered.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_getRegistrationId_notRegistered - + @@ -37,7 +37,7 @@ Authors: //==== TEST_CRITERIA MNA MR setup({timeout: 90000}); -var t = async_test("PushManager_getRegistrationId_notRegistered", {timeout: 90000}), returnedValue, unregisterServiceSuccessCallback, unregisterServiceErrorCallback; +var t = async_test(document.title, {timeout: 90000}), returnedValue, unregisterServiceSuccessCallback, unregisterServiceErrorCallback; t.step(function () { unregisterServiceSuccessCallback = t.step_func(function () { @@ -47,12 +47,13 @@ t.step(function () { }); unregisterServiceErrorCallback = t.step_func(function (error) { - assert_unreached("Error occurred: " + error.name + " :" + error.message); + assert_unreached("Error occurred: " + error.name + ":" + error.message); }); tizen.push.unregisterService(unregisterServiceSuccessCallback, unregisterServiceErrorCallback); -}, "Check if method getRegistrationId of PushManager returns default value"); +}); + diff --git a/tct-push-tizen-tests/push/PushManager_in_tizen.html b/tct-push-tizen-tests/push/PushManager_in_tizen.html index 6c3af9d4a..4d5a5cc46 100644 --- a/tct-push-tizen-tests/push/PushManager_in_tizen.html +++ b/tct-push-tizen-tests/push/PushManager_in_tizen.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + -PushManager_notexist +PushManager_in_tizen - + @@ -35,10 +35,11 @@ Authors: //==== SPEC Tizen Web API:TBD:Push:PushManager:PushManager U //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA OBME -test(function() { +test(function () { assert_true("push" in tizen, "No push in tizen."); check_readonly(tizen, "push", tizen.push, "object", "dummyValue"); -}, "PushManager_in_tizen"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_notexist.html b/tct-push-tizen-tests/push/PushManager_notexist.html index 1b0ed6743..3e8c04d34 100644 --- a/tct-push-tizen-tests/push/PushManager_notexist.html +++ b/tct-push-tizen-tests/push/PushManager_notexist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_notexist - + @@ -37,7 +37,8 @@ Authors: //==== TEST_CRITERIA NIO test(function () { check_no_interface_object("PushManager"); -}, "PushManager_notexist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_registerService.html b/tct-push-tizen-tests/push/PushManager_registerService.html index 7c486f962..7c52031ee 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService.html +++ b/tct-push-tizen-tests/push/PushManager_registerService.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService - + @@ -38,7 +38,7 @@ Authors: //==== TEST_CRITERIA MOA MAST MR setup({timeout: 90000}); -var t = async_test("PushManager_registerService", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, pushRegisterErrorCallback, returnedValue = null, unregisterServiceSuccessCallback, unregisterServiceDone, beforeRegistrationId, unregisterServiceErrorCallback, unregisterServiceError; @@ -49,7 +49,7 @@ t.step(function () { }); unregisterServiceError = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); pushRegisterSuccessCallback = t.step_func(function (registrationId) { @@ -67,7 +67,7 @@ t.step(function () { }); pushRegisterErrorCallback = t.step_func(function (error) { - assert_unreached("registerService() error occurred: " + error.name + " :" + error.message); + assert_unreached("registerService() error occurred: " + error.name + ":" + error.message); }); unregisterServiceSuccessCallback = t.step_func(function () { @@ -76,11 +76,12 @@ t.step(function () { }); unregisterServiceErrorCallback = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); tizen.push.unregisterService(unregisterServiceSuccessCallback, unregisterServiceErrorCallback); }); + diff --git a/tct-push-tizen-tests/push/PushManager_registerService_appControl_TypeMismatch.html b/tct-push-tizen-tests/push/PushManager_registerService_appControl_TypeMismatch.html index 4b668fe4d..1f1a10732 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService_appControl_TypeMismatch.html +++ b/tct-push-tizen-tests/push/PushManager_registerService_appControl_TypeMismatch.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService_appControl_TypeMismatch - + @@ -35,11 +35,11 @@ Authors: //==== PRIORITY: P2 //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:TBD:Push:PushManager:registerService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA MC setup({timeout: 90000}); -var t = async_test("PushManager_registerService_appControl_TypeMismatch", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, errorCallback, conversionTable, exceptionName, incorrectService, i; @@ -58,13 +58,14 @@ t.step(function () { incorrectService = conversionTable[i][0]; exceptionName = conversionTable[i][1]; - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.registerService(incorrectService, pushRegisterSuccessCallback, errorCallback); }, exceptionName + " should be thrown - given incorrect ApplicationControl: " + incorrectService); } t.done(); }); + diff --git a/tct-push-tizen-tests/push/PushManager_registerService_appControl_invalid_obj.html b/tct-push-tizen-tests/push/PushManager_registerService_appControl_invalid_obj.html index f2cbb496f..40e10d4f6 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService_appControl_invalid_obj.html +++ b/tct-push-tizen-tests/push/PushManager_registerService_appControl_invalid_obj.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService_appControl_invalid_obj - + @@ -35,11 +35,11 @@ Authors: //==== PRIORITY: P2 //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:TBD:Push:PushManager:registerService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA MTO setup({timeout: 90000}); -var t = async_test("PushManager_registerService_appControl_invalid_obj", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, errorCallback, exceptionName = "TypeMismatchError", fakeService; t.step(function () { @@ -59,12 +59,13 @@ t.step(function () { data: [] }; - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.registerService(fakeService, pushRegisterSuccessCallback, errorCallback); }, exceptionName + " should be thrown - given incorrect ApplicationControl"); t.done(); }); + diff --git a/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_TypeMismatch.html b/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_TypeMismatch.html index 674943ef1..d82f802b5 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_TypeMismatch.html +++ b/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_TypeMismatch.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService_errorCallback_TypeMismatch - + @@ -35,11 +35,11 @@ Authors: //==== PRIORITY: P2 //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:TBD:Push:PushManager:registerService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA MC setup({timeout: 90000}); -var t = async_test("PushManager_registerService_errorCallback_TypeMismatch", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), registerSuccessCallback, conversionTable, incorrectCallback, exceptionName, i; t.step(function () { @@ -52,13 +52,14 @@ t.step(function () { incorrectCallback = conversionTable[i][0]; exceptionName = conversionTable[i][1]; - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.registerService(service, registerSuccessCallback, incorrectCallback); }, exceptionName + " should be thrown - given incorrect error callback - " + incorrectCallback); } t.done(); }); + diff --git a/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_invalid_cb.html b/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_invalid_cb.html index 8d436c753..a662f3045 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_invalid_cb.html +++ b/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_invalid_cb.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService_errorCallback_invalid_cb - + @@ -31,15 +31,15 @@ Authors:
diff --git a/tct-push-tizen-tests/push/PushManager_registerService_exist.html b/tct-push-tizen-tests/push/PushManager_registerService_exist.html index 383b9a798..ccb4ae8d1 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService_exist.html +++ b/tct-push-tizen-tests/push/PushManager_registerService_exist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService_exist - + @@ -37,7 +37,8 @@ Authors: test(function () { assert_true("registerService" in tizen.push, "No registerService method in tizen.push"); check_method_exists(tizen.push, "registerService"); -}, "PushManager_registerService_exist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_registerService_misargs.html b/tct-push-tizen-tests/push/PushManager_registerService_misargs.html index 5a8ef6777..c9b55bd20 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService_misargs.html +++ b/tct-push-tizen-tests/push/PushManager_registerService_misargs.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService_misargs - + @@ -33,19 +33,20 @@ Authors: //==== TEST: PushManager_registerService_misargs //==== LABEL Check if method registerService throws exception when non-optional argument is missing //==== SPEC Tizen Web API:TBD:Push:PushManager:registerService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA MMA test(function () { var exceptionName = "TypeMismatchError"; try { - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.registerService(); }, exceptionName + " should be thrown - missing ApplicationControl ."); } finally { tizen.push.unregisterService(); } -}, "PushManager_registerService_misargs"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_registerService_successCallback_TypeMismatch.html b/tct-push-tizen-tests/push/PushManager_registerService_successCallback_TypeMismatch.html index 379b14b2f..1424dc3f1 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService_successCallback_TypeMismatch.html +++ b/tct-push-tizen-tests/push/PushManager_registerService_successCallback_TypeMismatch.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService_successCallback_TypeMismatch - + @@ -35,11 +35,11 @@ Authors: //==== PRIORITY: P2 //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:TBD:Push:PushManager:registerService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA MC setup({timeout: 90000}); -var t = async_test("PushManager_registerService_successCallback_TypeMismatch", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), errorCallback, conversionTable, incorrectCallback, exceptionName, i; t.step(function () { @@ -52,13 +52,14 @@ t.step(function () { incorrectCallback = conversionTable[i][0]; exceptionName = conversionTable[i][1]; - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.registerService(service, incorrectCallback, errorCallback); }, exceptionName + " should be thrown - given incorrect success callback - " + incorrectCallback); } t.done(); }); + diff --git a/tct-push-tizen-tests/push/PushManager_registerService_successCallback_invalid_cb.html b/tct-push-tizen-tests/push/PushManager_registerService_successCallback_invalid_cb.html index 4d2c08e8f..8f7fcbf48 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService_successCallback_invalid_cb.html +++ b/tct-push-tizen-tests/push/PushManager_registerService_successCallback_invalid_cb.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService_successCallback_invalid_cb - + @@ -31,15 +31,15 @@ Authors:
diff --git a/tct-push-tizen-tests/push/PushManager_registerService_without_errorCallback.html b/tct-push-tizen-tests/push/PushManager_registerService_without_errorCallback.html index 699e1b47e..b98ff03d6 100644 --- a/tct-push-tizen-tests/push/PushManager_registerService_without_errorCallback.html +++ b/tct-push-tizen-tests/push/PushManager_registerService_without_errorCallback.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_registerService_without_errorCallback - + @@ -33,12 +33,12 @@ Authors: //==== TEST: PushManager_registerService_without_errorCallback //==== LABEL Check if method registerService of PushManager works properly without errorCallback //==== SPEC Tizen Web API:TBD:Push:PushManager:registerService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== ONLOAD_DELAY 90 //==== TEST_CRITERIA MMINA MAST MR setup({timeout: 90000}); -var t = async_test("PushManager_registerService_without_errorCallback", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, returnedValue = null, beforeRegistrationId, unregisterServiceSuccessCallback, unregisterServiceDone, unregisterServiceError, unregisterServiceErrorCallback; @@ -49,7 +49,7 @@ t.step(function () { }); unregisterServiceError = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); pushRegisterSuccessCallback = t.step_func(function (registrationId) { @@ -72,11 +72,12 @@ t.step(function () { }); unregisterServiceErrorCallback = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); tizen.push.unregisterService(unregisterServiceSuccessCallback, unregisterServiceErrorCallback); }); + diff --git a/tct-push-tizen-tests/push/PushManager_unregisterService.html b/tct-push-tizen-tests/push/PushManager_unregisterService.html index 5634a84cd..a46b63876 100644 --- a/tct-push-tizen-tests/push/PushManager_unregisterService.html +++ b/tct-push-tizen-tests/push/PushManager_unregisterService.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_unregisterService - + @@ -33,12 +33,12 @@ Authors: //==== TEST: PushManager_unregisterService //==== LABEL Check if unregisterService works correctly //==== SPEC Tizen Web API:TBD:Push:PushManager:unregisterService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== ONLOAD_DELAY 90 //==== TEST_CRITERIA MOA MAST MR setup({timeout: 90000}); -var t = async_test("PushManager_unregisterService", {timeout: 90000}), pushRegisterSuccessCallback, +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, pushRegisterErrorCallback, unregisterServiceDone, unregisterServiceError, registrationId, afterRegistrationId, returnedValue = null; @@ -52,7 +52,7 @@ t.step(function () { }); unregisterServiceError = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); pushRegisterSuccessCallback = t.step_func(function (successRegistrationId) { @@ -61,11 +61,12 @@ t.step(function () { }); pushRegisterErrorCallback = t.step_func(function (error) { - assert_unreached("registerService() error occurred: " + error.name + " :" + error.message); + assert_unreached("registerService() error occurred: " + error.name + ":" + error.message); }); tizen.push.registerService(service, pushRegisterSuccessCallback, pushRegisterErrorCallback); }); + diff --git a/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_TypeMismatch.html b/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_TypeMismatch.html index dc01041a8..43ea21b1c 100644 --- a/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_TypeMismatch.html +++ b/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_TypeMismatch.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_unregisterService_errorCallback_TypeMismatch - + @@ -34,11 +34,11 @@ Authors: //==== PRIORITY: P2 //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:TBD:Push:PushManager:unregisterService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA MC setup({timeout: 90000}); -var t = async_test("PushManager_unregisterService_errorCallback_TypeMismatch", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), unregisterSuccessCallback, conversionTable, incorrectCallback, exceptionName, i; t.step(function () { @@ -51,13 +51,14 @@ t.step(function () { incorrectCallback = conversionTable[i][0]; exceptionName = conversionTable[i][1]; - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.unregisterService(unregisterSuccessCallback, incorrectCallback); }, exceptionName + " should be thrown - given incorrect error callback - " + incorrectCallback); } t.done(); }); + diff --git a/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_invalid_cb.html b/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_invalid_cb.html index f5bf61976..ec015a753 100644 --- a/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_invalid_cb.html +++ b/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_invalid_cb.html @@ -15,30 +15,30 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_unregisterService_errorCallback_invalid_cb - +
diff --git a/tct-push-tizen-tests/push/PushManager_unregisterService_exist.html b/tct-push-tizen-tests/push/PushManager_unregisterService_exist.html index 92b3362cb..2a5025244 100644 --- a/tct-push-tizen-tests/push/PushManager_unregisterService_exist.html +++ b/tct-push-tizen-tests/push/PushManager_unregisterService_exist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_unregisterService_exist - + @@ -37,7 +37,8 @@ Authors: test(function () { assert_true("unregisterService" in tizen.push, "No unregisterService method in tizen.push"); check_method_exists(tizen.push, "unregisterService"); -}, "PushManager_unregisterService_exist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_TypeMismatch.html b/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_TypeMismatch.html index 2da9c9e3a..686396292 100644 --- a/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_TypeMismatch.html +++ b/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_TypeMismatch.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_unregisterService_successCallback_TypeMismatch - + @@ -34,11 +34,11 @@ Authors: //==== PRIORITY: P2 //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:TBD:Push:PushManager:unregisterService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== TEST_CRITERIA MC setup({timeout: 90000}); -var t = async_test("PushManager_unregisterService_successCallback_TypeMismatch", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), errorCallback, conversionTable, incorrectCallback, exceptionName, i; t.step(function () { @@ -51,13 +51,14 @@ t.step(function () { incorrectCallback = conversionTable[i][0]; exceptionName = conversionTable[i][1]; - assert_throws({name : exceptionName}, + assert_throws({name: exceptionName}, function () { tizen.push.unregisterService(incorrectCallback, errorCallback); }, exceptionName + " should be thrown - given incorrect success callback - " + incorrectCallback); } t.done(); }); + diff --git a/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_invalid_cb.html b/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_invalid_cb.html index 51198fc0e..e7cce16c4 100644 --- a/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_invalid_cb.html +++ b/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_invalid_cb.html @@ -15,30 +15,30 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_unregisterService_successCallback_invalid_cb - +
diff --git a/tct-push-tizen-tests/push/PushManager_unregisterService_without_errorCallback.html b/tct-push-tizen-tests/push/PushManager_unregisterService_without_errorCallback.html index 7c0c060f2..0d65e9cab 100644 --- a/tct-push-tizen-tests/push/PushManager_unregisterService_without_errorCallback.html +++ b/tct-push-tizen-tests/push/PushManager_unregisterService_without_errorCallback.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_unregisterService_without_errorCallback - + @@ -33,12 +33,12 @@ Authors: //==== TEST: PushManager_unregisterService_without_errorCallback //==== LABEL Check if unregisterService method works without errorCallback //==== SPEC Tizen Web API:TBD:Push:PushManager:unregisterService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== ONLOAD_DELAY 90 //==== TEST_CRITERIA MOA MAST MR setup({timeout: 90000}); -var t = async_test("PushManager_unregisterService_without_errorCallback", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, pushRegisterErrorCallback, unregisterServiceDone, unregisterServiceError, registrationId, afterRegistrationId, returnedValue = null; @@ -53,7 +53,7 @@ t.step(function () { }); unregisterServiceError = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); pushRegisterSuccessCallback = t.step_func(function (successRegistrationId) { @@ -62,11 +62,12 @@ t.step(function () { }); pushRegisterErrorCallback = t.step_func(function (error) { - assert_unreached("registerService() error occurred: " + error.name + " :" + error.message); + assert_unreached("registerService() error occurred: " + error.name + ":" + error.message); }); tizen.push.registerService(service, pushRegisterSuccessCallback, pushRegisterErrorCallback); }); + diff --git a/tct-push-tizen-tests/push/PushManager_unregisterService_without_successCallback.html b/tct-push-tizen-tests/push/PushManager_unregisterService_without_successCallback.html index 72552496b..bb1513c5a 100644 --- a/tct-push-tizen-tests/push/PushManager_unregisterService_without_successCallback.html +++ b/tct-push-tizen-tests/push/PushManager_unregisterService_without_successCallback.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushManager_unregisterService_without_successCallback - + @@ -33,12 +33,12 @@ Authors: //==== TEST: PushManager_unregisterService_without_successCallback //==== LABEL Check if unregisterService method works without successCallback //==== SPEC Tizen Web API:TBD:Push:PushManager:unregisterService M -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== ONLOAD_DELAY 90 //==== TEST_CRITERIA MMINA MR setup({timeout: 90000}); -var t = async_test("PushManager_unregisterService_without_successCallback", {timeout: 90000}), +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, errorCallback, returnedValue = null; t.step(function () { @@ -49,11 +49,12 @@ t.step(function () { }); errorCallback = t.step_func(function (error) { - assert_unreached("Error occurred: " + error.name + " :" + error.message); + assert_unreached("Error occurred: " + error.name + ":" + error.message); }); tizen.push.registerService(service, pushRegisterSuccessCallback, errorCallback); }); + diff --git a/tct-push-tizen-tests/push/PushMessage_notexist.html b/tct-push-tizen-tests/push/PushMessage_notexist.html index fafc350a6..15a1ad46b 100644 --- a/tct-push-tizen-tests/push/PushMessage_notexist.html +++ b/tct-push-tizen-tests/push/PushMessage_notexist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushMessage_notexist - + @@ -37,7 +37,8 @@ Authors: //==== TEST_CRITERIA NIO test(function () { check_no_interface_object("PushMessage"); -}, "PushMessage_notexist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushNotificationCallback_notexist.html b/tct-push-tizen-tests/push/PushNotificationCallback_notexist.html index b7c3204f9..2a309b343 100644 --- a/tct-push-tizen-tests/push/PushNotificationCallback_notexist.html +++ b/tct-push-tizen-tests/push/PushNotificationCallback_notexist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushNotificationCallback_notexist - + @@ -37,7 +37,8 @@ Authors: //==== TEST_CRITERIA CBNIO test(function () { check_no_interface_object("PushNotificationCallback"); -}, "PushNotificationCallback_notexist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushRegisterSuccessCallback_notexist.html b/tct-push-tizen-tests/push/PushRegisterSuccessCallback_notexist.html index dfcdec84f..8932d5c88 100644 --- a/tct-push-tizen-tests/push/PushRegisterSuccessCallback_notexist.html +++ b/tct-push-tizen-tests/push/PushRegisterSuccessCallback_notexist.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushRegisterSuccessCallback_notexist - + @@ -37,7 +37,8 @@ Authors: //==== TEST_CRITERIA CBNIO test(function () { check_no_interface_object("PushRegisterSuccessCallback"); -}, "PushRegisterSuccessCallback_notexist"); +}, document.title); + diff --git a/tct-push-tizen-tests/push/PushRegisterSuccessCallback_onsuccess.html b/tct-push-tizen-tests/push/PushRegisterSuccessCallback_onsuccess.html index f3fcb3fa2..92319cddf 100644 --- a/tct-push-tizen-tests/push/PushRegisterSuccessCallback_onsuccess.html +++ b/tct-push-tizen-tests/push/PushRegisterSuccessCallback_onsuccess.html @@ -15,15 +15,15 @@ See the License for the specific language governing permissions and limitations under the License. Authors: - Andrzej Krolikowski + Andrzej Krolikowski --> - + PushRegisterSuccessCallback_onsuccess - + @@ -34,12 +34,12 @@ Authors: //==== LABEL Check if PushRegisterSuccessCallback works //==== PRIORITY P3 //==== SPEC Tizen Web API:TBD:Push:PushRegisterSuccessCallback:onsuccess U -//==== SPEC_URL https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html +//==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html //==== ONLOAD_DELAY 90 //==== TEST_CRITERIA CBT CBOA setup({timeout: 90000}); -var t = async_test("PushRegisterSuccessCallback_onsuccess", {timeout:90000}), pushRegisterSuccessCallback, +var t = async_test(document.title, {timeout: 90000}), pushRegisterSuccessCallback, pushRegisterErrorCallback, unregisterServiceDone, unregisterServiceError; t.step(function () { @@ -48,7 +48,7 @@ t.step(function () { }); unregisterServiceError = t.step_func(function (error) { - assert_unreached("unregisterService() error occurred: " + error.name + " :" + error.message); + assert_unreached("unregisterService() error occurred: " + error.name + ":" + error.message); }); pushRegisterSuccessCallback = t.step_func(function (registrationId) { @@ -61,12 +61,13 @@ t.step(function () { }); pushRegisterErrorCallback = t.step_func(function (error) { - assert_unreached("registerService() error occurred: " + error.name + " :" + error.message); + assert_unreached("registerService() error occurred: " + error.name + ":" + error.message); }); tizen.push.registerService(service, pushRegisterSuccessCallback, pushRegisterErrorCallback); }); + diff --git a/tct-push-tizen-tests/push/support/unitcommon.js b/tct-push-tizen-tests/push/support/unitcommon.js new file mode 100644 index 000000000..9f972c1eb --- /dev/null +++ b/tct-push-tizen-tests/push/support/unitcommon.js @@ -0,0 +1,559 @@ +/* + +Copyright (c) 2013 Samsung Electronics Co., Ltd. + +Licensed under the Apache License, Version 2.0 (the License); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + + +Authors: + + */ + + +MIN_BYTE = -128; +MAX_BYTE = 127; +MIN_OCTET = 0; +MAX_OCTET = 255; +MIN_SHORT = -32768; +MAX_SHORT = 32767; +MIN_UNSIGNED_SHORT = 0; +MAX_UNSIGNED_SHORT = 65535; +MIN_LONG = -2147483648; +MAX_LONG = 2147483647; +MIN_UNSIGNED_LONG = 0; +MAX_UNSIGNED_LONG = 4294967295; +MIN_LONG_LONG = -9223372036854775808; +MAX_LONG_LONG = 9223372036854775807; +MIN_UNSIGNED_LONG_LONG = 0; +MAX_UNSIGNED_LONG_LONG = 18446744073709551615; + +TYPE_MISMATCH_EXCEPTION = {name: 'TypeMismatchError'}; +NOT_FOUND_EXCEPTION = {name: 'NotFoundError'}; +INVALID_VALUES_EXCEPTION = {name: 'InvalidValuesError'}; +IO_EXCEPTION = {name: 'IOError'}; +SECURITY_EXCEPTION = {name: 'SecurityError'}; + + +(function () { + var head_src = document.head.innerHTML; + if (head_src.search(/\/testharness.js\W/) === -1) { + document.write('\n'); + } + if (head_src.search(/\/testharnessreport.js\W/) === -1) { + document.write('\n'); + } +})(); + +var _registered_types = {}; + +function _resolve_registered_type(type) { + while (type in _registered_types) { + type = _registered_types[type]; + } + return type; +} + +/** + * Method checks extra argument for none argument method. + * The only check is that method will not throw an exception. + * Example usage: + * checkExtraArgument(tizen.notification, "removeAll"); + * + * @param object object + * @param methodName string - name of the method + */ +function checkExtraArgument(object, methodName) { + var extraArgument = [ + null, + undefined, + "Tizen", + 1, + false, + ["one", "two"], + {argument: 1}, + function () {} + ], i; + + for (i = 0; i < extraArgument.length; i++) { + object[methodName](extraArgument[i]); + } +} + +/** + * Method to validate conversion. + * Example usage: + * conversionTable = getTypeConversionExceptions("functionObject", true); + * for(i = 0; i < conversionTable.length; i++) { + * errorCallback = conversionTable[i][0]; + * exceptionName = conversionTable[i][1]; + * + * assert_throws({name : exceptionName}, + * function () { + * tizen.systemsetting.setProperty("HOME_SCREEN", + * propertyValue, successCallback, errorCallback); + * }, exceptionName + " should be thrown - given incorrect errorCallback."); + * } + * + * @param conversionType + * @param isOptional + * @returns table of tables which contain value (index 0) and exceptionName (index 1) + * + */ +function getTypeConversionExceptions(conversionType, isOptional) { + var exceptionName = "TypeMismatchError", + conversionTable; + switch (conversionType) { + case "enum": + conversionTable = [ + [undefined, exceptionName], + [null, exceptionName], + [0, exceptionName], + [true, exceptionName], + ["dummyInvalidEnumValue", exceptionName], + [{ }, exceptionName] + ]; + break; + case "double": + conversionTable = [ + [undefined, exceptionName], + [NaN, exceptionName], + [Number.POSITIVE_INFINITY, exceptionName], + [Number.NEGATIVE_INFINITY, exceptionName], + ["TIZEN", exceptionName], + [{ name : "TIZEN" }, exceptionName], + [function () { }, exceptionName] + ]; + break; + case "object": + conversionTable = [ + [true, exceptionName], + [false, exceptionName], + [NaN, exceptionName], + [0, exceptionName], + ["", exceptionName], + ["TIZEN", exceptionName], + [undefined, exceptionName] + ]; + if (!isOptional) { + conversionTable.push([null, exceptionName]); + } + break; + case "functionObject": + conversionTable = [ + [true, exceptionName], + [false, exceptionName], + [NaN, exceptionName], + [0, exceptionName], + ["", exceptionName], + ["TIZEN", exceptionName], + [[], exceptionName], + [{ }, exceptionName], + [undefined, exceptionName] + ]; + if (!isOptional) { + conversionTable.push([null, exceptionName]); + } + break; + case "array": + conversionTable = [ + [true, exceptionName], + [false, exceptionName], + [NaN, exceptionName], + [0, exceptionName], + ["", exceptionName], + ["TIZEN", exceptionName], + [{ }, exceptionName], + [function () { }, exceptionName], + [undefined, exceptionName] + ]; + if (!isOptional) { + conversionTable.push([null, exceptionName]); + } + break; + case "dictionary": + conversionTable = [ + [true, exceptionName], + [false, exceptionName], + [NaN, exceptionName], + [0, exceptionName], + ["", exceptionName], + ["TIZEN", exceptionName], + [undefined, exceptionName] + ]; + if (!isOptional) { + conversionTable.push([null, exceptionName]); + } + break; + default: + assert_unreached("Fix your test. Wrong conversionType '" + conversionType + "'."); + }; + + return conversionTable; +} + + +function assert_type(obj, type, description) { + var org_type = type, prop_name, prop_type, prop_value; + + type = _resolve_registered_type(type); + + if (typeof (type) === 'string') { + type = type.toLowerCase(); + switch (type) { + case 'object': + case 'string': + case 'number': + case 'function': + case 'boolean': + case 'undefined': + case 'xml': + assert_equals(typeof (obj), type, description); + break; + case 'null': + assert_true(obj === null, description); + break; + case 'array': + assert_true(Array.isArray(obj), description); + break; + case 'date': + assert_true(obj instanceof Date, description); + break; + case 'byte': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); + assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); + break; + case 'octet': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_OCTET, description + " - value too low."); + assert_less_than_equal(obj, MAX_OCTET, description + " - value too high."); + assert_equals(obj % 1, 0, description + " - value is not an integer."); + break; + case 'short': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); + assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); + break; + case 'unsigned short': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_UNSIGNED_SHORT, description + " - value too low."); + assert_less_than_equal(obj, MAX_UNSIGNED_SHORT, description + " - value too high."); + assert_equals(obj % 1, 0, description + " - value is not an integer."); + break; + case 'long': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); + assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); + break; + case 'unsigned long': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_UNSIGNED_LONG, description + " - value too low."); + assert_less_than_equal(obj, MAX_UNSIGNED_LONG, description + " - value too high."); + assert_equals(obj % 1, 0, description + " - value is not an integer."); + break; + case 'long long': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); + assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); + assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); + break; + case 'unsigned long long': + assert_equals(typeof (obj), 'number', description); + assert_greater_than_equal(obj, MIN_UNSIGNED_LONG_LONG, description + " - value too low."); + assert_less_than_equal(obj, MAX_UNSIGNED_LONG_LONG, description + " - value too high."); + assert_equals(obj % 1, 0, description + " - value is not an integer."); + break; + default: + assert_unreached('Fix your test. Wrong type \'' + org_type + '\''); + } + } else if (typeof (type) === 'function') { + assert_true(obj instanceof type, description); + } else if (typeof (type) === 'object') { + for (prop_name in type) { + prop_type = type[prop_name]; + if (prop_type === 'function') { + assert_inherits(obj, prop_name); + assert_equals(typeof obj[prop_name], prop_type, 'Object should have method ' + prop_name); + } else { + assert_own_property(obj, prop_name); + } + } + } else { + assert_unreached('Fix your test. Wrong type ' + org_type); + } +} + +function register_type(alias, type_spec) { + _registered_types[alias] = type_spec; +} + +/** + * Method to check if attribute is const. + * Example usage: + * check_const(tizen.bluetooth.deviceMinor, 'TOY_DOLL', 0x03, 'number', 0x29B); + * + * @param obj object to test which has const attribute + * @param attributeName attribute name. + * @param expectedValue expected value of provided attribute name + * @param expectedType expected type of provided attribute name + * @param valueToAssign value to assign in order to check if attribute value can be modified + */ +function check_const(obj, attributeName, expectedValue, expectedType, valueToAssign) { + var tmp; + if (expectedValue === valueToAssign) { + assert_unreached("Fix your test. The same values given for " + attributeName + + " in 'value' and 'valueToSet' arguments."); + } + if (typeof (attributeName) === "string") { + assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object."); + assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent."); + if (typeof (expectedType) !== "undefined") { + if (expectedValue === null) { + assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different."); + } else { + assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different."); + } + } else { + assert_unreached("Fix your test. Wrong type " + expectedType); + } + tmp = obj[attributeName]; + obj[attributeName] = valueToAssign; + assert_equals(obj[attributeName], tmp, attributeName + " can be modified."); + } else { + assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName)); + } +} + +/** + * Method to check if attribute is readonly. + * Example usage: + * check_readonly(statusNotification, "postedTime", null, 'object', new Date()); + * + * @param obj object to test which has readonly attribute + * @param attributeName attribute name. + * @param expectedValue expected value of provided attribute name + * @param expectedType expected type of provided attribute name + * @param valueToAssign value to assign in order to check if attribute value can be modified + */ +function check_readonly(obj, attributeName, expectedValue, expectedType, valueToAssign) { + check_const(obj, attributeName, expectedValue, expectedType, valueToAssign); +} + +/** + * Method to check if attribute can be set to null. + * Example usage: + * check_not_nullable(syncInfo, "mode"); + * + * @param obj object to test which has not nullable attribute + * @param attributeName attribute name. + */ +function check_not_nullable(obj, attributeName) +{ var old_value = obj[attributeName]; + obj[attributeName] = null; + assert_not_equals(obj[attributeName], null, "Attribute " + attributeName + " can be set to null."); + obj[attributeName] = old_value; +} + +/** + * Method to check NoInterfaceObject + * Example usage: + * check_no_interface_object("BluetoothAdapter") + * + * @param interfaceName interface name + */ +function check_no_interface_object(interfaceName) { + assert_throws({name: "TypeError"}, function () { + tizen[interfaceName](); + },"Wrong call as a function"); + assert_throws({name: "TypeError"}, function () { + new tizen[interfaceName](); + },"Wrong call as a new function"); + assert_throws({name: "TypeError"}, function () { + ({}) instanceof tizen[interfaceName]; + },"instanceof exception"); + assert_equals(tizen[interfaceName], undefined, interfaceName + " is not undefined."); +} + + +/** + * Method to check Constructors + * Example usage: + * check_constructor("BluetoothAdapter") + * + * @param constructorName constructor name + */ + +function check_constructor(constructorName) { + assert_true(constructorName in tizen, "No " + constructorName + " in tizen."); + assert_false({} instanceof tizen[constructorName],"Custom object is not instance of " + constructorName); + assert_throws({ + name: "TypeError" + }, function () { + tizen[constructorName](); + }, "Constructor called as function."); +} + +/** + * Method to check if given method can be overridden in a given object - (TEMPORARY REMOVED). + * That method also checks if given method exists in a given object. + * Example usage: + * check_method_exists(tizen.notification, "get"); + * + * @param obj object with method + * @param methodName name of the method to check. + */ +function check_method_exists(obj, methodName) { + assert_type(obj[methodName], 'function', "Method does not exist."); +} + +/** + * Method to check extensibility of given object. + * Method checks if new attribute and method can be added. + * Example usage: + * check_extensibility(tizen.notification); + * + * @param obj object to check + */ +function check_extensibility(obj) { + var dummyAttribute = "dummyAttributeValue", dummyMethodResult = "dummyMethodResultValue"; + obj.newDummyMethod = function() { + return dummyMethodResult; + } + assert_equals(obj.newDummyMethod(), dummyMethodResult, "Incorrect result from added method."); + + obj.newDummyAttribute = dummyAttribute; + assert_equals(obj.newDummyAttribute, dummyAttribute, "Incorrect result from added attribute."); +} + +/** + * Method to check if attribute can be modify. + * Example usage: + * check_attr(downloadRequest, "fileName", default_val, "string", "file_name.html"); + * + * @param obj object to test which has not readonly attribute + * @param attributeName attribute name. + * @param expectedValue expected value of provided attribute name + * @param expectedType expected type of provided attribute name + * @param valueToAssign value to assign in order to check if attribute value can be modified + */ +function check_attribute(obj, attributeName, expectedValue, expectedType, valueToAssign) { + if (expectedValue === valueToAssign) { + assert_unreached("Fix your test. The same values given for " + attributeName + + " in 'value' and 'valueToSet' arguments."); + } + if (typeof (attributeName) === "string") { + assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object."); + assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent."); + if (typeof (expectedType) !== "undefined") { + if (expectedValue === null) { + assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different."); + } else { + assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different."); + } + } else { + assert_unreached("Fix your test. Wrong type " + expectedType); + } + obj[attributeName] = valueToAssign; + assert_equals(obj[attributeName], valueToAssign, attributeName + " can be modified."); + } else { + assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName)); + } +} + +/** + * Method to check if whole array can be overwritten with an invalid value. + * Sample usage: + * check_invalid_array_assignments(message, "to", false); + * + * @param obj object which has the array as its property + * @param array name of the array to check + * @param isNullable indicates if the array can be null + */ +function check_invalid_array_assignments(obj, array, isNullable) { + var args = [undefined, true, false, NaN, 0, "TIZEN", {}, function () {}], + val = obj[array], i; + + if (!isNullable) { + obj[array] = null; + assert_not_equals(obj[array], null, "Non-nullable array was set to null"); + assert_type(obj[array], "array", "Non-nullable array type changed after assigning null"); + assert_equals(obj[array].toString(), val.toString(), "Non-nullable array contents changed after assigning null"); + } + + for (i = 0 ; i < args.length ; i++) { + obj[array] = args[i]; + assert_type(obj[array], "array", "Array type changed after assigning an invalid value"); + assert_equals(obj[array].toString(), val.toString(), "Array contents changed after assigning an invalid value"); + } +} + +/** + * Method to check if an object can be overwritten with an invalid value. + * Sample usage: + * check_invalid_object_assignments(message, "body", false); + * + * @param parentObj object which has the 'obj' object as its property + * @param obj name of the object to check + * @param isNullable indicates if the object can be null + */ +function check_invalid_obj_assignments(parentObj, obj, isNullable) { + var args = [undefined, true, false, NaN, 0, "TIZEN", function () {}], + val = parentObj[obj], i; + + if (!isNullable) { + parentObj[obj] = null; + assert_equals(parentObj[obj], val, "Non-nullable obj was modified after assigning null"); + } + + for (i = 0 ; i < args.length ; i++) { + parentObj[obj] = args[i]; + assert_equals(parentObj[obj], val, "The object was set to " + args[i]); + } +} + +/** + * Method to validate conversion for listeners. + * Example usage: + * incorrectListeners = getListenerConversionExceptions(["oninstalled", "onupdated", "onuninstalled"]); + * for(i = 0; i < incorrectListeners.length; i++) { + * packageInformationEventCallback = incorrectListeners[i][0]; + * exceptionName = incorrectListeners[i][1]; + * assert_throws({name : exceptionName}, + * function () { + * tizen.package.setPackageInfoEventListener(packageInformationEventCallback); + * }, exceptionName + " should be thrown - given incorrect successCallback."); + * } + * + * + * @param callbackNames Array with names + * @returns {Array} table of tables which contain incorrect listener (index 0) and exceptionName (index 1) + * + */ +function getListenerConversionExceptions(callbackNames) { + var result = [], conversionTable, i, j, listenerName; + conversionTable = getTypeConversionExceptions("functionObject", false); + + for (i = 0; i < callbackNames.length; i++) { + for (j = 0; j < conversionTable.length; j++) { + listenerName = {}; + listenerName[callbackNames[i]] = conversionTable[j][0]; + result.push([listenerName, conversionTable[j][1]]); + } + } + + return result; +} diff --git a/tct-push-tizen-tests/resources/unitcommon.js b/tct-push-tizen-tests/resources/unitcommon.js deleted file mode 100644 index 9f972c1eb..000000000 --- a/tct-push-tizen-tests/resources/unitcommon.js +++ /dev/null @@ -1,559 +0,0 @@ -/* - -Copyright (c) 2013 Samsung Electronics Co., Ltd. - -Licensed under the Apache License, Version 2.0 (the License); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - - -Authors: - - */ - - -MIN_BYTE = -128; -MAX_BYTE = 127; -MIN_OCTET = 0; -MAX_OCTET = 255; -MIN_SHORT = -32768; -MAX_SHORT = 32767; -MIN_UNSIGNED_SHORT = 0; -MAX_UNSIGNED_SHORT = 65535; -MIN_LONG = -2147483648; -MAX_LONG = 2147483647; -MIN_UNSIGNED_LONG = 0; -MAX_UNSIGNED_LONG = 4294967295; -MIN_LONG_LONG = -9223372036854775808; -MAX_LONG_LONG = 9223372036854775807; -MIN_UNSIGNED_LONG_LONG = 0; -MAX_UNSIGNED_LONG_LONG = 18446744073709551615; - -TYPE_MISMATCH_EXCEPTION = {name: 'TypeMismatchError'}; -NOT_FOUND_EXCEPTION = {name: 'NotFoundError'}; -INVALID_VALUES_EXCEPTION = {name: 'InvalidValuesError'}; -IO_EXCEPTION = {name: 'IOError'}; -SECURITY_EXCEPTION = {name: 'SecurityError'}; - - -(function () { - var head_src = document.head.innerHTML; - if (head_src.search(/\/testharness.js\W/) === -1) { - document.write('\n'); - } - if (head_src.search(/\/testharnessreport.js\W/) === -1) { - document.write('\n'); - } -})(); - -var _registered_types = {}; - -function _resolve_registered_type(type) { - while (type in _registered_types) { - type = _registered_types[type]; - } - return type; -} - -/** - * Method checks extra argument for none argument method. - * The only check is that method will not throw an exception. - * Example usage: - * checkExtraArgument(tizen.notification, "removeAll"); - * - * @param object object - * @param methodName string - name of the method - */ -function checkExtraArgument(object, methodName) { - var extraArgument = [ - null, - undefined, - "Tizen", - 1, - false, - ["one", "two"], - {argument: 1}, - function () {} - ], i; - - for (i = 0; i < extraArgument.length; i++) { - object[methodName](extraArgument[i]); - } -} - -/** - * Method to validate conversion. - * Example usage: - * conversionTable = getTypeConversionExceptions("functionObject", true); - * for(i = 0; i < conversionTable.length; i++) { - * errorCallback = conversionTable[i][0]; - * exceptionName = conversionTable[i][1]; - * - * assert_throws({name : exceptionName}, - * function () { - * tizen.systemsetting.setProperty("HOME_SCREEN", - * propertyValue, successCallback, errorCallback); - * }, exceptionName + " should be thrown - given incorrect errorCallback."); - * } - * - * @param conversionType - * @param isOptional - * @returns table of tables which contain value (index 0) and exceptionName (index 1) - * - */ -function getTypeConversionExceptions(conversionType, isOptional) { - var exceptionName = "TypeMismatchError", - conversionTable; - switch (conversionType) { - case "enum": - conversionTable = [ - [undefined, exceptionName], - [null, exceptionName], - [0, exceptionName], - [true, exceptionName], - ["dummyInvalidEnumValue", exceptionName], - [{ }, exceptionName] - ]; - break; - case "double": - conversionTable = [ - [undefined, exceptionName], - [NaN, exceptionName], - [Number.POSITIVE_INFINITY, exceptionName], - [Number.NEGATIVE_INFINITY, exceptionName], - ["TIZEN", exceptionName], - [{ name : "TIZEN" }, exceptionName], - [function () { }, exceptionName] - ]; - break; - case "object": - conversionTable = [ - [true, exceptionName], - [false, exceptionName], - [NaN, exceptionName], - [0, exceptionName], - ["", exceptionName], - ["TIZEN", exceptionName], - [undefined, exceptionName] - ]; - if (!isOptional) { - conversionTable.push([null, exceptionName]); - } - break; - case "functionObject": - conversionTable = [ - [true, exceptionName], - [false, exceptionName], - [NaN, exceptionName], - [0, exceptionName], - ["", exceptionName], - ["TIZEN", exceptionName], - [[], exceptionName], - [{ }, exceptionName], - [undefined, exceptionName] - ]; - if (!isOptional) { - conversionTable.push([null, exceptionName]); - } - break; - case "array": - conversionTable = [ - [true, exceptionName], - [false, exceptionName], - [NaN, exceptionName], - [0, exceptionName], - ["", exceptionName], - ["TIZEN", exceptionName], - [{ }, exceptionName], - [function () { }, exceptionName], - [undefined, exceptionName] - ]; - if (!isOptional) { - conversionTable.push([null, exceptionName]); - } - break; - case "dictionary": - conversionTable = [ - [true, exceptionName], - [false, exceptionName], - [NaN, exceptionName], - [0, exceptionName], - ["", exceptionName], - ["TIZEN", exceptionName], - [undefined, exceptionName] - ]; - if (!isOptional) { - conversionTable.push([null, exceptionName]); - } - break; - default: - assert_unreached("Fix your test. Wrong conversionType '" + conversionType + "'."); - }; - - return conversionTable; -} - - -function assert_type(obj, type, description) { - var org_type = type, prop_name, prop_type, prop_value; - - type = _resolve_registered_type(type); - - if (typeof (type) === 'string') { - type = type.toLowerCase(); - switch (type) { - case 'object': - case 'string': - case 'number': - case 'function': - case 'boolean': - case 'undefined': - case 'xml': - assert_equals(typeof (obj), type, description); - break; - case 'null': - assert_true(obj === null, description); - break; - case 'array': - assert_true(Array.isArray(obj), description); - break; - case 'date': - assert_true(obj instanceof Date, description); - break; - case 'byte': - assert_equals(typeof (obj), 'number', description); - assert_greater_than_equal(obj, MIN_BYTE, description + " - value too low."); - assert_less_than_equal(obj, MAX_BYTE, description + " - value too high."); - assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); - break; - case 'octet': - assert_equals(typeof (obj), 'number', description); - assert_greater_than_equal(obj, MIN_OCTET, description + " - value too low."); - assert_less_than_equal(obj, MAX_OCTET, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); - break; - case 'short': - assert_equals(typeof (obj), 'number', description); - assert_greater_than_equal(obj, MIN_SHORT, description + " - value too low."); - assert_less_than_equal(obj, MAX_SHORT, description + " - value too high."); - assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); - break; - case 'unsigned short': - assert_equals(typeof (obj), 'number', description); - assert_greater_than_equal(obj, MIN_UNSIGNED_SHORT, description + " - value too low."); - assert_less_than_equal(obj, MAX_UNSIGNED_SHORT, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); - break; - case 'long': - assert_equals(typeof (obj), 'number', description); - assert_greater_than_equal(obj, MIN_LONG, description + " - value too low."); - assert_less_than_equal(obj, MAX_LONG, description + " - value too high."); - assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); - break; - case 'unsigned long': - assert_equals(typeof (obj), 'number', description); - assert_greater_than_equal(obj, MIN_UNSIGNED_LONG, description + " - value too low."); - assert_less_than_equal(obj, MAX_UNSIGNED_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); - break; - case 'long long': - assert_equals(typeof (obj), 'number', description); - assert_greater_than_equal(obj, MIN_LONG_LONG, description + " - value too low."); - assert_less_than_equal(obj, MAX_LONG_LONG, description + " - value too high."); - assert_equals(Math.abs(obj % 1), 0, description + " - value is not an integer."); - break; - case 'unsigned long long': - assert_equals(typeof (obj), 'number', description); - assert_greater_than_equal(obj, MIN_UNSIGNED_LONG_LONG, description + " - value too low."); - assert_less_than_equal(obj, MAX_UNSIGNED_LONG_LONG, description + " - value too high."); - assert_equals(obj % 1, 0, description + " - value is not an integer."); - break; - default: - assert_unreached('Fix your test. Wrong type \'' + org_type + '\''); - } - } else if (typeof (type) === 'function') { - assert_true(obj instanceof type, description); - } else if (typeof (type) === 'object') { - for (prop_name in type) { - prop_type = type[prop_name]; - if (prop_type === 'function') { - assert_inherits(obj, prop_name); - assert_equals(typeof obj[prop_name], prop_type, 'Object should have method ' + prop_name); - } else { - assert_own_property(obj, prop_name); - } - } - } else { - assert_unreached('Fix your test. Wrong type ' + org_type); - } -} - -function register_type(alias, type_spec) { - _registered_types[alias] = type_spec; -} - -/** - * Method to check if attribute is const. - * Example usage: - * check_const(tizen.bluetooth.deviceMinor, 'TOY_DOLL', 0x03, 'number', 0x29B); - * - * @param obj object to test which has const attribute - * @param attributeName attribute name. - * @param expectedValue expected value of provided attribute name - * @param expectedType expected type of provided attribute name - * @param valueToAssign value to assign in order to check if attribute value can be modified - */ -function check_const(obj, attributeName, expectedValue, expectedType, valueToAssign) { - var tmp; - if (expectedValue === valueToAssign) { - assert_unreached("Fix your test. The same values given for " + attributeName + - " in 'value' and 'valueToSet' arguments."); - } - if (typeof (attributeName) === "string") { - assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object."); - assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent."); - if (typeof (expectedType) !== "undefined") { - if (expectedValue === null) { - assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different."); - } else { - assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different."); - } - } else { - assert_unreached("Fix your test. Wrong type " + expectedType); - } - tmp = obj[attributeName]; - obj[attributeName] = valueToAssign; - assert_equals(obj[attributeName], tmp, attributeName + " can be modified."); - } else { - assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName)); - } -} - -/** - * Method to check if attribute is readonly. - * Example usage: - * check_readonly(statusNotification, "postedTime", null, 'object', new Date()); - * - * @param obj object to test which has readonly attribute - * @param attributeName attribute name. - * @param expectedValue expected value of provided attribute name - * @param expectedType expected type of provided attribute name - * @param valueToAssign value to assign in order to check if attribute value can be modified - */ -function check_readonly(obj, attributeName, expectedValue, expectedType, valueToAssign) { - check_const(obj, attributeName, expectedValue, expectedType, valueToAssign); -} - -/** - * Method to check if attribute can be set to null. - * Example usage: - * check_not_nullable(syncInfo, "mode"); - * - * @param obj object to test which has not nullable attribute - * @param attributeName attribute name. - */ -function check_not_nullable(obj, attributeName) -{ var old_value = obj[attributeName]; - obj[attributeName] = null; - assert_not_equals(obj[attributeName], null, "Attribute " + attributeName + " can be set to null."); - obj[attributeName] = old_value; -} - -/** - * Method to check NoInterfaceObject - * Example usage: - * check_no_interface_object("BluetoothAdapter") - * - * @param interfaceName interface name - */ -function check_no_interface_object(interfaceName) { - assert_throws({name: "TypeError"}, function () { - tizen[interfaceName](); - },"Wrong call as a function"); - assert_throws({name: "TypeError"}, function () { - new tizen[interfaceName](); - },"Wrong call as a new function"); - assert_throws({name: "TypeError"}, function () { - ({}) instanceof tizen[interfaceName]; - },"instanceof exception"); - assert_equals(tizen[interfaceName], undefined, interfaceName + " is not undefined."); -} - - -/** - * Method to check Constructors - * Example usage: - * check_constructor("BluetoothAdapter") - * - * @param constructorName constructor name - */ - -function check_constructor(constructorName) { - assert_true(constructorName in tizen, "No " + constructorName + " in tizen."); - assert_false({} instanceof tizen[constructorName],"Custom object is not instance of " + constructorName); - assert_throws({ - name: "TypeError" - }, function () { - tizen[constructorName](); - }, "Constructor called as function."); -} - -/** - * Method to check if given method can be overridden in a given object - (TEMPORARY REMOVED). - * That method also checks if given method exists in a given object. - * Example usage: - * check_method_exists(tizen.notification, "get"); - * - * @param obj object with method - * @param methodName name of the method to check. - */ -function check_method_exists(obj, methodName) { - assert_type(obj[methodName], 'function', "Method does not exist."); -} - -/** - * Method to check extensibility of given object. - * Method checks if new attribute and method can be added. - * Example usage: - * check_extensibility(tizen.notification); - * - * @param obj object to check - */ -function check_extensibility(obj) { - var dummyAttribute = "dummyAttributeValue", dummyMethodResult = "dummyMethodResultValue"; - obj.newDummyMethod = function() { - return dummyMethodResult; - } - assert_equals(obj.newDummyMethod(), dummyMethodResult, "Incorrect result from added method."); - - obj.newDummyAttribute = dummyAttribute; - assert_equals(obj.newDummyAttribute, dummyAttribute, "Incorrect result from added attribute."); -} - -/** - * Method to check if attribute can be modify. - * Example usage: - * check_attr(downloadRequest, "fileName", default_val, "string", "file_name.html"); - * - * @param obj object to test which has not readonly attribute - * @param attributeName attribute name. - * @param expectedValue expected value of provided attribute name - * @param expectedType expected type of provided attribute name - * @param valueToAssign value to assign in order to check if attribute value can be modified - */ -function check_attribute(obj, attributeName, expectedValue, expectedType, valueToAssign) { - if (expectedValue === valueToAssign) { - assert_unreached("Fix your test. The same values given for " + attributeName + - " in 'value' and 'valueToSet' arguments."); - } - if (typeof (attributeName) === "string") { - assert_true(attributeName in obj, "Name " + attributeName + " doesn't exist in provided object."); - assert_equals(obj[attributeName], expectedValue, "Value of " + attributeName + " is diffrent."); - if (typeof (expectedType) !== "undefined") { - if (expectedValue === null) { - assert_type(obj[attributeName], "object", "Type of " + attributeName + " is different."); - } else { - assert_type(obj[attributeName], expectedType, "Type of " + attributeName + " is different."); - } - } else { - assert_unreached("Fix your test. Wrong type " + expectedType); - } - obj[attributeName] = valueToAssign; - assert_equals(obj[attributeName], valueToAssign, attributeName + " can be modified."); - } else { - assert_unreached("Fix your test. Wrong type of name " + typeof (attributeName)); - } -} - -/** - * Method to check if whole array can be overwritten with an invalid value. - * Sample usage: - * check_invalid_array_assignments(message, "to", false); - * - * @param obj object which has the array as its property - * @param array name of the array to check - * @param isNullable indicates if the array can be null - */ -function check_invalid_array_assignments(obj, array, isNullable) { - var args = [undefined, true, false, NaN, 0, "TIZEN", {}, function () {}], - val = obj[array], i; - - if (!isNullable) { - obj[array] = null; - assert_not_equals(obj[array], null, "Non-nullable array was set to null"); - assert_type(obj[array], "array", "Non-nullable array type changed after assigning null"); - assert_equals(obj[array].toString(), val.toString(), "Non-nullable array contents changed after assigning null"); - } - - for (i = 0 ; i < args.length ; i++) { - obj[array] = args[i]; - assert_type(obj[array], "array", "Array type changed after assigning an invalid value"); - assert_equals(obj[array].toString(), val.toString(), "Array contents changed after assigning an invalid value"); - } -} - -/** - * Method to check if an object can be overwritten with an invalid value. - * Sample usage: - * check_invalid_object_assignments(message, "body", false); - * - * @param parentObj object which has the 'obj' object as its property - * @param obj name of the object to check - * @param isNullable indicates if the object can be null - */ -function check_invalid_obj_assignments(parentObj, obj, isNullable) { - var args = [undefined, true, false, NaN, 0, "TIZEN", function () {}], - val = parentObj[obj], i; - - if (!isNullable) { - parentObj[obj] = null; - assert_equals(parentObj[obj], val, "Non-nullable obj was modified after assigning null"); - } - - for (i = 0 ; i < args.length ; i++) { - parentObj[obj] = args[i]; - assert_equals(parentObj[obj], val, "The object was set to " + args[i]); - } -} - -/** - * Method to validate conversion for listeners. - * Example usage: - * incorrectListeners = getListenerConversionExceptions(["oninstalled", "onupdated", "onuninstalled"]); - * for(i = 0; i < incorrectListeners.length; i++) { - * packageInformationEventCallback = incorrectListeners[i][0]; - * exceptionName = incorrectListeners[i][1]; - * assert_throws({name : exceptionName}, - * function () { - * tizen.package.setPackageInfoEventListener(packageInformationEventCallback); - * }, exceptionName + " should be thrown - given incorrect successCallback."); - * } - * - * - * @param callbackNames Array with names - * @returns {Array} table of tables which contain incorrect listener (index 0) and exceptionName (index 1) - * - */ -function getListenerConversionExceptions(callbackNames) { - var result = [], conversionTable, i, j, listenerName; - conversionTable = getTypeConversionExceptions("functionObject", false); - - for (i = 0; i < callbackNames.length; i++) { - for (j = 0; j < conversionTable.length; j++) { - listenerName = {}; - listenerName[callbackNames[i]] = conversionTable[j][0]; - result.push([listenerName, conversionTable[j][1]]); - } - } - - return result; -} diff --git a/tct-push-tizen-tests/tests.full.xml b/tct-push-tizen-tests/tests.full.xml index 3a9d3c7e0..a50c55861 100644 --- a/tct-push-tizen-tests/tests.full.xml +++ b/tct-push-tizen-tests/tests.full.xml @@ -25,7 +25,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -78,7 +78,7 @@ - + /opt/tct-push-tizen-tests/push/PushManager_extend.html @@ -157,7 +157,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -169,7 +169,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -181,7 +181,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -205,19 +205,19 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD - + /opt/tct-push-tizen-tests/push/PushManager_registerService_successCallback_invalid_cb.html - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -265,19 +265,19 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD - + /opt/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_invalid_cb.html - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -289,19 +289,19 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD - + /opt/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_invalid_cb.html - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -313,19 +313,19 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD - + /opt/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_invalid_cb.html - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -337,7 +337,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -349,7 +349,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -361,7 +361,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -373,7 +373,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -385,7 +385,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -397,7 +397,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -409,7 +409,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -421,7 +421,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -433,7 +433,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD @@ -445,7 +445,7 @@ - https://developer.tizen.org/help/index.jsp?topic=/org.tizen.web.device.apireference/tizen/push.html + https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/push.html TBD diff --git a/tct-push-tizen-tests/tests.xml b/tct-push-tizen-tests/tests.xml index 0b2538440..7763b8746 100644 --- a/tct-push-tizen-tests/tests.xml +++ b/tct-push-tizen-tests/tests.xml @@ -36,7 +36,7 @@ /opt/tct-push-tizen-tests/push/PushManager_disconnectService_extra_argument.html - + /opt/tct-push-tizen-tests/push/PushManager_extend.html @@ -91,7 +91,7 @@ /opt/tct-push-tizen-tests/push/PushManager_registerService_successCallback_TypeMismatch.html - + /opt/tct-push-tizen-tests/push/PushManager_registerService_successCallback_invalid_cb.html @@ -116,7 +116,7 @@ /opt/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_TypeMismatch.html - + /opt/tct-push-tizen-tests/push/PushManager_unregisterService_errorCallback_invalid_cb.html @@ -126,7 +126,7 @@ /opt/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_TypeMismatch.html - + /opt/tct-push-tizen-tests/push/PushManager_registerService_errorCallback_invalid_cb.html @@ -136,7 +136,7 @@ /opt/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_TypeMismatch.html - + /opt/tct-push-tizen-tests/push/PushManager_unregisterService_successCallback_invalid_cb.html