From: Witold Choinkowski Date: Thu, 29 Aug 2013 11:10:31 +0000 (+0200) Subject: [Bluetooth] cleaning after the test X-Git-Tag: 2.2.1_release~161 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=abc92ebf726de94f7a86cbb8666ce6af7074ccc8;p=test%2Ftct%2Fweb%2Fapi.git [Bluetooth] cleaning after the test Change-Id: I07d89db9f4191e91b98e5f48e8b89ac32d55c577 --- diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_discoverDevices_callback_onerror.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_discoverDevices_callback_onerror.html index 6385065de..8166ca32f 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_discoverDevices_callback_onerror.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_discoverDevices_callback_onerror.html @@ -56,7 +56,6 @@ t.step(function () { }; errorCallback = t.step_func(function (error) { assert_equals(error.name, "ServiceNotAvailableError", "expected another error"); - adapter.stopDiscovery(); t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_discoverDevices_callback_successful.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_discoverDevices_callback_successful.html index 14865064d..01b582a03 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_discoverDevices_callback_successful.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_discoverDevices_callback_successful.html @@ -46,18 +46,14 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothAdapter:discoverDevices M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MOA MAST -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var t = async_test("BluetoothAdapter_discoverDevices_callback_successful",{timeout: 90000}); t.step(function () { - var adapter, discoverDevicesErrorCallback, startDiscoveryDevice, discoverDevicesSuccessCallback, stopDiscoverySuccessCB; - - stopDiscoverySuccessCB = t.step_func(function () { - t.done(); - }); + var adapter, discoverDevicesErrorCallback, startDiscoveryDevice, discoverDevicesSuccessCallback; discoverDevicesSuccessCallback = { onstarted: t.step_func(function () { - adapter.stopDiscovery(stopDiscoverySuccessCB); + t.done(); }), ondevicefound: t.step_func(function (device) { }), @@ -76,6 +72,7 @@ t.step(function () { }); adapter = tizen.bluetooth.getDefaultAdapter(); + setBluetoothDiscoveryCleanup(adapter); adapter.setPowered(true, startDiscoveryDevice); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID.html index 347c3e8a9..260793a02 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID.html @@ -46,20 +46,21 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothAdapter:registerRFCOMMServiceByUUID M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MMINA MAST MR -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter = null,t = async_test("BluetoothAdapter_registerRFCOMMServiceByUUID",{ timeout: 90000 }), registerRFCOMMServiceByUUIDSuccess, powerOnSuccess, powerOnError, retValue = null; t.step(function () { - registerRFCOMMServiceByUUIDSuccess = t.step_func(function (recordHandler) { - assert_true("uuid" in recordHandler, "No uuid in recordHandler"); - assert_true("name" in recordHandler, "No name in recordHandler"); - assert_true("isConnected" in recordHandler, "No isConnected in recordHandler"); - assert_true("onconnect" in recordHandler, "No onconnect in recordHandler"); - assert_type(recordHandler.unregister, "function", "Method unregister does not exist."); - recordHandler.unregister(); + registerRFCOMMServiceByUUIDSuccess = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); + assert_true("uuid" in handler, "No uuid in recordHandler"); + assert_true("name" in handler, "No name in recordHandler"); + assert_true("isConnected" in handler, "No isConnected in recordHandler"); + assert_true("onconnect" in handler, "No onconnect in recordHandler"); + assert_type(handler.unregister, "function", "Method unregister does not exist."); assert_equals(retValue, undefined, "registerRFCOMMServiceByUUID returns wrong value"); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onconnect_successful.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onconnect_successful.html index 9d47e96af..6a39c0820 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onconnect_successful.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onconnect_successful.html @@ -52,24 +52,15 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== PRE tct-bt-helper MUST be launched on the remote device. //==== TEST_CRITERIA MOA MAST -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter = null,t = async_test("BluetoothAdapter_registerRFCOMMServiceByUUID_onconnect_successful",{timeout:90000}), - registerRFCOMMServiceByUUIDSuccess, registerRFCOMMServiceByUUIDError, powerOnSuccess, powerOnError, serviceHandler, + registerRFCOMMServiceByUUIDSuccess, registerRFCOMMServiceByUUIDError, powerOnSuccess, powerOnError, visibleSuccess, visibleError; t.step(function () { - add_result_callback(function (res) { - serviceHandler.unregister(); - }); - - registerRFCOMMServiceByUUIDSuccess = t.step_func(function (recordHandler) { - serviceHandler = recordHandler; - recordHandler.onconnect = t.step_func(function (socket) { - if(recordHandler !== null) { - recordHandler.unregister(function() { - recordHandler = null; - }); - } + registerRFCOMMServiceByUUIDSuccess = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); + handler.onconnect = t.step_func(function (socket) { t.done(); }); alert("1. Push \"Search\" button on the remote device.\n" + diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onerror.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onerror.html index 46f02b91d..b94873b9f 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onerror.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onerror.html @@ -45,29 +45,24 @@ Authors: //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothAdapter:registerRFCOMMServiceByUUID M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html -//==== PRE Tests should be run separately //==== TEST_CRITERIA MERRCB -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var t = async_test("BluetoothAdapter_registerRFCOMMServiceByUUID_onerror", {timeout: 90000}), - adapter, powerOffSuccess, powerOffError, chatServiceSuccessCallback, chatServiceErrorCallback, serviceHandler; + adapter, powerOffSuccess, powerOffError, chatServiceSuccessCallback, chatServiceErrorCallback; t.step(function () { - add_result_callback(function (res) { - if (serviceHandler) { - serviceHandler.unregister(); - } - }); chatServiceSuccessCallback = t.step_func(function (handler) { - serviceHandler = handler; + setBluetoothHandlerCleanup(handler); assert_unreached("Shouldn't be here"); }); chatServiceErrorCallback = t.step_func(function (e) { assert_equals(e.name, "ServiceNotAvailableError", "error name in chatServiceErrorCallback"); t.done(); + done(); }); powerOffSuccess = t.step_func(function () { diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_with_errorCallback.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_with_errorCallback.html index b2d2a5281..5ce7f62d2 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_with_errorCallback.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_with_errorCallback.html @@ -46,24 +46,20 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothAdapter:registerRFCOMMServiceByUUID M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MOA -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var adapter = null,t = async_test("BluetoothAdapter_registerRFCOMMServiceByUUID_with_errorCallback", {timeout: 90000}), - registerRFCOMMServiceByUUIDSuccess, registerRFCOMMServiceByUUIDError, powerOnSuccess, powerOnError, serviceHandler; + registerRFCOMMServiceByUUIDSuccess, registerRFCOMMServiceByUUIDError, powerOnSuccess, powerOnError; t.step(function () { - add_result_callback(function (res) { - serviceHandler.unregister(); - }); - registerRFCOMMServiceByUUIDSuccess = t.step_func(function (recordHandler) { - serviceHandler = recordHandler; + setBluetoothHandlerCleanup(recordHandler); assert_true("uuid" in recordHandler, "No uuid in recordHandler"); assert_true("name" in recordHandler, "No name in recordHandler"); assert_true("isConnected" in recordHandler, "No isConnected in recordHandler"); assert_true("onconnect" in recordHandler, "No onconnect in recordHandler"); assert_type(recordHandler.unregister, "function", "Method unregister does not exist."); - recordHandler.unregister(); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplicationSuccessCallback_onsuccess.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplicationSuccessCallback_onsuccess.html index c5afedf9c..a9ce5fcd8 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplicationSuccessCallback_onsuccess.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplicationSuccessCallback_onsuccess.html @@ -38,13 +38,14 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA CBT CBOA -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var adapter, t = async_test("BluetoothHealthApplicationSuccessCallback_onsuccess", {timeout: 90000}), healthProfileHandler, powerOnSuccess, powerOnError, healthRegisterSuccess; t.step(function () { healthRegisterSuccess = t.step_func(function (app) { + setBluetoothHandlerCleanup(app); assert_type(app, "object", "argument app has wrong type"); assert_true("dataType" in app, "no dataType attribute in BluetoothHealthApplication"); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_dataType_attribute.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_dataType_attribute.html index 07d3aac80..0a71e4fb1 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_dataType_attribute.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_dataType_attribute.html @@ -39,21 +39,21 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\ //==== TEST_CRITERIA AE AT ARO -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, healthProfileHandler,powerOnSuccess , powerOnError, healthRegisterSuccess, healthRegisterError, t = async_test("BluetoothHealthApplication_dataType_attribute", {timeout:90000}), appName = "testSinkApp"; t.step(function () { - adapter = tizen.bluetooth.getDefaultAdapter(); - healthRegisterSuccess = t.step_func(function (registerHealthApp) { - assert_equals(registerHealthApp.dataType, REMOTE_HEALTH_DEVICE_TYPE, "dataType in BluetoothHealthApplication has wrong value"); - assert_type(registerHealthApp.dataType, "unsigned short", "dataType in BluetoothHealthApplication has wrong type"); + adapter = tizen.bluetooth.getDefaultAdapter(); - registerHealthApp.dataType = 4103; - assert_equals(registerHealthApp.dataType, REMOTE_HEALTH_DEVICE_TYPE, "dataType in BluetoothHealthApplication is writable"); + healthRegisterSuccess = t.step_func(function (healthApp) { + setBluetoothHandlerCleanup(healthApp); + assert_equals(healthApp.dataType, REMOTE_HEALTH_DEVICE_TYPE, "dataType in BluetoothHealthApplication has wrong value"); + assert_type(healthApp.dataType, "unsigned short", "dataType in BluetoothHealthApplication has wrong type"); - registerHealthApp.unregister(); + healthApp.dataType = 4103; + assert_equals(healthApp.dataType, REMOTE_HEALTH_DEVICE_TYPE, "dataType in BluetoothHealthApplication is writable"); t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_extend.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_extend.html index cb5c90ee4..cff08732e 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_extend.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_extend.html @@ -39,17 +39,16 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\ //==== TEST_CRITERIA OBX -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, healthProfileHandler,powerOnSuccess , powerOnError, healthRegisterSuccess, healthRegisterError, t = async_test("BluetoothHealthApplication_extend", {timeout:90000}); t.step(function () { adapter = tizen.bluetooth.getDefaultAdapter(); - healthRegisterSuccess = t.step_func(function (registerHealthApp) { - check_extensibility(registerHealthApp); - - registerHealthApp.unregister(); + healthRegisterSuccess = t.step_func(function (healthApp) { + setBluetoothHandlerCleanup(healthApp); + check_extensibility(healthApp); t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_name_attribute.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_name_attribute.html index b059bdae7..6b8398a2e 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_name_attribute.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_name_attribute.html @@ -39,21 +39,20 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\ //==== TEST_CRITERIA AE AT ARO -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, healthProfileHandler,powerOnSuccess , powerOnError, healthRegisterSuccess, healthRegisterError, t = async_test("BluetoothHealthApplication_name_attribute", {timeout:90000}), appName = "testSinkApp"; t.step(function () { adapter = tizen.bluetooth.getDefaultAdapter(); - healthRegisterSuccess = t.step_func(function (registerHealthApp) { - assert_equals(registerHealthApp.name, appName, "name in BluetoothHealthApplication has wrong value"); - assert_type(registerHealthApp.name, "string", "name in BluetoothHealthApplication has wrong type"); + healthRegisterSuccess = t.step_func(function (healthApp) { + setBluetoothHandlerCleanup(healthApp); + assert_equals(healthApp.name, appName, "name in BluetoothHealthApplication has wrong value"); + assert_type(healthApp.name, "string", "name in BluetoothHealthApplication has wrong type"); - registerHealthApp.name = "testName"; - assert_equals(registerHealthApp.name, appName, "name in BluetoothHealthApplication is writable"); - - registerHealthApp.unregister(); + healthApp.name = "testName"; + assert_equals(healthApp.name, appName, "name in BluetoothHealthApplication is writable"); t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_onconnect_attribute.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_onconnect_attribute.html index 3f2f1188b..c1eeef878 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_onconnect_attribute.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_onconnect_attribute.html @@ -39,21 +39,20 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\ //==== TEST_CRITERIA AE ADV ASG AT -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, healthProfileHandler,powerOnSuccess , powerOnError, healthRegisterSuccess, healthRegisterError, testOnconnect, t = async_test("BluetoothHealthApplication_onconnect_attribute", {timeout:90000}), appName = "testSinkApp"; t.step(function () { adapter = tizen.bluetooth.getDefaultAdapter(); - healthRegisterSuccess = t.step_func(function (registerHealthApp) { - assert_equals(registerHealthApp.onconnect, null, "onconnect in BluetoothHealthApplication has wrong default value"); + healthRegisterSuccess = t.step_func(function (healthApp) { + setBluetoothHandlerCleanup(healthApp); + assert_equals(healthApp.onconnect, null, "onconnect in BluetoothHealthApplication has wrong default value"); testOnconnect = function () {}; - registerHealthApp.onconnect = testOnconnect; - assert_equals(registerHealthApp.onconnect, testOnconnect, "onconnect in BluetoothHealthApplication is not writable"); - - registerHealthApp.unregister(); + healthApp.onconnect = testOnconnect; + assert_equals(healthApp.onconnect, testOnconnect, "onconnect in BluetoothHealthApplication is not writable"); t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister.html index 5ecc1f71a..913f22ead 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister.html @@ -39,7 +39,7 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MMINA MR -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, healthProfileHandler,powerOnSuccess , powerOnError, healthRegisterSuccess, healthRegisterError, t = async_test("BluetoothHealthApplication_unregister", {timeout:90000}), appName = "testSinkApp", retValue = null; @@ -47,6 +47,7 @@ t.step(function () { adapter = tizen.bluetooth.getDefaultAdapter(); healthRegisterSuccess = t.step_func(function (registerHealthApp) { + setBluetoothHandlerCleanup(registerHealthApp); retValue = registerHealthApp.unregister(); assert_equals(retValue, undefined, "unregister returns wrong value"); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_errorCallback_TypeMismatch.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_errorCallback_TypeMismatch.html index ec13da887..d82ff2b4c 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_errorCallback_TypeMismatch.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_errorCallback_TypeMismatch.html @@ -39,7 +39,7 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MC -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, healthProfileHandler, powerOnSuccess , powerOnError, healthRegisterSuccess, healthRegisterError, t = async_test("BluetoothHealthApplication_unregister_errorCallback_TypeMismatch", {timeout:90000}), appName = "testSinkApp", argument, exceptionName, i, conversionTable = getTypeConversionExceptions("functionObject", true), successCallback; @@ -52,6 +52,7 @@ t.step(function () { }); healthRegisterSuccess = t.step_func(function (registerHealthApp) { + setBluetoothHandlerCleanup(registerHealthApp); for(i = 0; i < conversionTable.length; i++) { argument = conversionTable[i][0]; exceptionName = conversionTable[i][1]; @@ -62,8 +63,6 @@ t.step(function () { }, exceptionName + " should be thrown - given incorrect argument."); } - registerHealthApp.unregister(); - t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_errorCallback_invalid_cb.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_errorCallback_invalid_cb.html index 85e136db6..3b17e387d 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_errorCallback_invalid_cb.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_errorCallback_invalid_cb.html @@ -39,7 +39,7 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MTCB -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, healthProfileHandler, powerOnSuccess , powerOnError, healthRegisterSuccess, healthRegisterError, t = async_test("BluetoothHealthApplication_unregister_errorCallback_invalid_cb", {timeout:90000}), appName = "testSinkApp", incorrectCallback, exceptionName = "TypeMismatchError", successCallback; @@ -58,13 +58,12 @@ t.step(function () { }); healthRegisterSuccess = t.step_func(function (registerHealthApp) { + setBluetoothHandlerCleanup(registerHealthApp); assert_throws({name : exceptionName}, function () { registerHealthApp.unregister(successCallback, incorrectCallback); }, exceptionName + " should be thrown - given incorrect argument."); - registerHealthApp.unregister(); - t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_exist.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_exist.html index c76b79069..2345f4966 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_exist.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_exist.html @@ -39,18 +39,17 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html\ //==== TEST_CRITERIA ME -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, healthProfileHandler,powerOnSuccess , powerOnError, healthRegisterSuccess, healthRegisterError, t = async_test("BluetoothHealthApplication_unregister_exist", {timeout:90000}), appName = "testSinkApp"; t.step(function () { adapter = tizen.bluetooth.getDefaultAdapter(); - healthRegisterSuccess = t.step_func(function (registerHealthApp) { - assert_true("unregister" in registerHealthApp, "unregister does not exist."); - check_method_exists(registerHealthApp, "unregister"); - - registerHealthApp.unregister(); + healthRegisterSuccess = t.step_func(function (healthApp) { + setBluetoothHandlerCleanup(healthApp); + assert_true("unregister" in healthApp, "unregister does not exist."); + check_method_exists(healthApp, "unregister"); t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_successCallback_TypeMismatch.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_successCallback_TypeMismatch.html index 7af4d2f9e..737c287f3 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_successCallback_TypeMismatch.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthApplication_unregister_successCallback_TypeMismatch.html @@ -39,7 +39,7 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MC -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, healthProfileHandler, powerOnSuccess , powerOnError, healthRegisterSuccess, healthRegisterError, t = async_test("BluetoothHealthApplication_unregister_successCallback_TypeMismatch", {timeout:90000}), appName = "testSinkApp", argument, exceptionName, i, conversionTable = getTypeConversionExceptions("functionObject", true); @@ -48,6 +48,7 @@ t.step(function () { adapter = tizen.bluetooth.getDefaultAdapter(); healthRegisterSuccess = t.step_func(function (registerHealthApp) { + setBluetoothHandlerCleanup(registerHealthApp); for(i = 0; i < conversionTable.length; i++) { argument = conversionTable[i][0]; exceptionName = conversionTable[i][1]; @@ -58,8 +59,6 @@ t.step(function () { }, exceptionName + " should be thrown - given incorrect argument."); } - registerHealthApp.unregister(); - t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthProfileHandler_registerSinkApplication.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthProfileHandler_registerSinkApplication.html index 2c08426f0..cf39528bc 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthProfileHandler_registerSinkApplication.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthProfileHandler_registerSinkApplication.html @@ -26,6 +26,7 @@ Authors: BluetoothHealthProfileHandler_registerSinkApplication +
@@ -36,23 +37,17 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothHealthProfileHandler:registerSinkApplication M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MMINA MAST MR -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter, t = async_test("BluetoothHealthProfileHandler_registerSinkApplication", {timeout:90000}), healthProfileHandler, - unregisterSuccess, unregisterError, powerOnSuccess, powerOnError, healthRegisterSuccess, retValue = null; + powerOnSuccess, powerOnError, healthRegisterSuccess, retValue = null; t.step(function () { - unregisterSuccess = t.step_func(function () { - t.done(); - }); - - unregisterError = t.step_func(function (e) { - assert_unreached("unregister exception:" + e.message); - }); - healthRegisterSuccess = t.step_func(function (app) { + setBluetoothHandlerCleanup(app); assert_type(app, "object", "argument app has wrong type"); assert_equals(retValue, undefined, "registerSinkApplication returns wrong value"); - app.unregister(unregisterSuccess, unregisterError); + + t.done(); }); powerOnSuccess = t.step_func(function () { diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthProfileHandler_registerSinkApplication_with_errorCallback.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthProfileHandler_registerSinkApplication_with_errorCallback.html index 1e1361690..0ebb6c4c1 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthProfileHandler_registerSinkApplication_with_errorCallback.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothHealthProfileHandler_registerSinkApplication_with_errorCallback.html @@ -38,23 +38,17 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MOA MAST -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var adapter, t = async_test("BluetoothHealthProfileHandler_registerSinkApplication_with_errorCallback", {timeout: 90000}), healthProfileHandler, - unregisterSuccess, unregisterError, powerOnSuccess, powerOnError, healthRegisterSuccess, healthRegisterError; + powerOnSuccess, powerOnError, healthRegisterSuccess, healthRegisterError; t.step(function () { - unregisterSuccess = t.step_func(function () { - t.done(); - }); - - unregisterError = t.step_func(function (e) { - assert_unreached("unregister exception:" + e.message); - }); - healthRegisterSuccess = t.step_func(function (app) { + setBluetoothHandlerCleanup(app); assert_type(app, "object", "argument app has wrong type"); - app.unregister(unregisterSuccess, unregisterError); + + t.done(); }); healthRegisterError = t.step_func(function (e) { diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_extend.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_extend.html index deb0410ce..8e3b6cdc7 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_extend.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_extend.html @@ -38,14 +38,16 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:BluetoothServiceHandler U //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA OBX -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var adapter = null, t = async_test("BluetoothServiceHandler_extend", {timeout: 90000}), powerOnError, powerOnSuccess, registerRFCOMMServiceByUUIDError, registerRFCOMMServiceByUUIDSuccess; t.step(function () { - registerRFCOMMServiceByUUIDSuccess = t.step_func(function (recordHandler) { - check_extensibility(recordHandler); - recordHandler.unregister(); + + registerRFCOMMServiceByUUIDSuccess = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); + check_extensibility(handler); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_isConnected_attribute.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_isConnected_attribute.html index 02b166e49..75f8b3b2f 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_isConnected_attribute.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_isConnected_attribute.html @@ -45,9 +45,8 @@ Authors: //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:isConnected A //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html -//==== PRE Tests should be run separately //==== TEST_CRITERIA AE AT ARO -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var t = async_test("BluetoothServiceHandler_isConnected_attribute", {timeout: 90000}); @@ -55,11 +54,11 @@ t.step(function () { var adapter, powerOnSuccess, powerOnError, chatServiceSuccessCallback, chatServiceErrorCallback, isConnected; - chatServiceSuccessCallback = t.step_func(function (recordHandler) { - isConnected = recordHandler.isConnected; - check_readonly(recordHandler, "isConnected", isConnected, "boolean", !(isConnected)); + chatServiceSuccessCallback = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); + isConnected = handler.isConnected; + check_readonly(handler, "isConnected", isConnected, "boolean", !(isConnected)); - recordHandler.unregister(); t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_name_attribute.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_name_attribute.html index 6b8daf939..bdc150926 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_name_attribute.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_name_attribute.html @@ -45,9 +45,8 @@ Authors: //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:name A //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html -//==== PRE Tests should be run separately //==== TEST_CRITERIA AE AT ARO -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var t = async_test("BluetoothServiceHandler_name_attribute", {timeout: 90000}); @@ -55,10 +54,11 @@ t.step(function () { var adapter, powerOnSuccess, powerOnError, chatServiceSuccessCallback, chatServiceErrorCallback, name; - chatServiceSuccessCallback = t.step_func(function (recordHandler) { - name = recordHandler.name; - check_readonly(recordHandler, "name", name, "string", name+"1234"); - recordHandler.unregister(); + chatServiceSuccessCallback = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); + name = handler.name; + check_readonly(handler, "name", name, "string", name+"1234"); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_onconnect_attribute.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_onconnect_attribute.html index 79335b77c..c18e7edb1 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_onconnect_attribute.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_onconnect_attribute.html @@ -44,11 +44,11 @@ Authors: //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== PRE tct-bt-helper MUST be launched on the remote device. //==== TEST_CRITERIA ASG AE AT ADV -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var this_test = async_test("BluetoothServiceHandler_onconnect_attribute", {timeout: 90000}); this_test.step(function () { var adapter, self, onError, TestMessage, registerSuccessCallback, sendMsg, chatServiceHandler, - data, recvmsg, checkmsg, i, expectedMsgFromClient, sendMsgData, MsgToClient, serviceHandler, visibleSuccess, visibleError; + data, recvmsg, checkmsg, i, expectedMsgFromClient, sendMsgData, MsgToClient, visibleSuccess, visibleError, poweredSuccess; adapter = tizen.bluetooth.getDefaultAdapter(); self = this; onError = self.step_func(function (e) { @@ -56,12 +56,8 @@ this_test.step(function () { }); TestMessage = "registerRFCOMMServiceByUUID"; - add_result_callback(function (res) { - serviceHandler.unregister(); - }); - registerSuccessCallback = self.step_func(function (handler) { - serviceHandler = handler; + setBluetoothHandlerCleanup(handler); sendMsg = ""; chatServiceHandler = handler; @@ -96,10 +92,6 @@ this_test.step(function () { sendMsgData(MsgToClient); }; - socket.onclose = function () { - adapter.setPowered(false, null, null); - }; - chatServiceHandler.unregister(); self.done(); }; assert_type(handler.onconnect, "function", "onconnect in BluetoothServiceHandler has wrong type after attaching function to it"); @@ -116,10 +108,10 @@ this_test.step(function () { visibleError = self.step_func(function (e) { assert_unreached("setVisible exception:" + e.message); }); - - adapter.setPowered(true,function(){ + poweredSuccess = self.step_func(function (e) { adapter.setVisible(true, visibleSuccess, visibleError); - },onError); + }); + adapter.setPowered(true, poweredSuccess, onError); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister.html index 589a0b9f1..8164ac9d9 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister.html @@ -35,15 +35,15 @@ Authors: //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:unregister M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html -//==== PRE Tests should be run separately //==== TEST_CRITERIA MMINA MR -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var adapter = null,t = async_test("BluetoothServiceHandler_unregister", {timeout: 90000}), registerRFCOMMServiceByUUIDSuccess, registerRFCOMMServiceByUUIDError, powerOnSuccess, powerOnError, retValue = null; t.step(function () { registerRFCOMMServiceByUUIDSuccess = t.step_func(function (recordHandler) { + setBluetoothHandlerCleanup(recordHandler); retValue = recordHandler.unregister(); assert_equals(retValue, undefined, "unregister returns wrong value"); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_errorCallback_TypeMismatch.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_errorCallback_TypeMismatch.html index 6c017e9f3..091c31bb8 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_errorCallback_TypeMismatch.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_errorCallback_TypeMismatch.html @@ -38,7 +38,7 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:unregister M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MC -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var adapter = null, t = async_test("BluetoothServiceHandler_unregister_errorCallback_TypeMismatch", {timeout: 90000}), exceptionName, errorCallback, i, @@ -51,6 +51,7 @@ t.step(function () { }); registerSuccessCB = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); for(i = 0; i < conversionTable.length; i++) { errorCallback = conversionTable[i][0]; exceptionName = conversionTable[i][1]; @@ -60,7 +61,7 @@ t.step(function () { handler.unregister(successCallback, errorCallback); }, exceptionName + " should be thrown - given incorrect errorCallback."); } - handler.unregister(); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_errorCallback_invalid_cb.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_errorCallback_invalid_cb.html index 299d31020..d0f416eb0 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_errorCallback_invalid_cb.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_errorCallback_invalid_cb.html @@ -38,7 +38,7 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:unregister M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MTCB -setup({timeout: 90000}); +setup({timeout: 90000, explicit_done:true}); var t = async_test("BluetoothServiceHandler_unregister_errorCallback_invalid_cb", {timeout: 90000}); t.step(function () { @@ -56,11 +56,12 @@ t.step(function () { }); registerSuccessCB = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); assert_throws({name : exceptionName}, function () { handler.unregister(unregisterSuccess, incorrectCallback); },exceptionName + " should be thrown - given incorrect error callback."); - handler.unregister(); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_exist.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_exist.html index 3bb3a8b76..aa47160ae 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_exist.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_exist.html @@ -46,16 +46,17 @@ Authors: //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:unregister M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html -//==== PRE Tests should be run separately //==== TEST_CRITERIA ME -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter = null, t = async_test("BluetoothServiceHandler_unregister_exist", {timeout:90000}), registerRFCOMMServiceByUUIDSuccess, registerRFCOMMServiceByUUIDError, powerOnSuccess, powerOnError; t.step(function () { - registerRFCOMMServiceByUUIDSuccess = t.step_func(function (recordHandler) { - assert_true("unregister" in recordHandler, "unregister in registerRFCOMMServiceByUUIDSuccess"); - check_method_exists(recordHandler, "unregister"); - recordHandler.unregister(); + + registerRFCOMMServiceByUUIDSuccess = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); + assert_true("unregister" in handler, "unregister in registerRFCOMMServiceByUUIDSuccess"); + check_method_exists(handler, "unregister"); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_successCallback_TypeMismatch.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_successCallback_TypeMismatch.html index 0099db94e..067aea628 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_successCallback_TypeMismatch.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_successCallback_TypeMismatch.html @@ -38,7 +38,7 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:unregister M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MC -setup({timeout: 90000}); +setup({timeout:90000, explicit_done:true}); var adapter = null, t = async_test("BluetoothServiceHandler_unregister_successCallback_TypeMismatch", {timeout: 90000}), exceptionName, i, conversionTable, errorCallback, registerSuccessCB, registerErrorCB, powerOnSuccess, powerOnError, successCallback; @@ -50,6 +50,7 @@ t.step(function () { }); registerSuccessCB = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); for(i = 0; i < conversionTable.length; i++) { successCallback = conversionTable[i][0]; exceptionName = conversionTable[i][1]; @@ -59,7 +60,7 @@ t.step(function () { handler.unregister(successCallback, errorCallback); }, exceptionName + " should be thrown - given incorrect successCallback."); } - handler.unregister(); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_successCallback_invalid_cb.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_successCallback_invalid_cb.html index fee1ceaf2..2a3dc2ff8 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_successCallback_invalid_cb.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_successCallback_invalid_cb.html @@ -38,7 +38,7 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:unregister M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA MTCB -setup({timeout: 90000}); +setup({timeout:90000, explicit_done:true}); var t = async_test("BluetoothServiceHandler_unregister_successCallback_invalid_cb", {timeout: 90000}); t.step(function () { @@ -56,11 +56,12 @@ t.step(function () { }); registerSuccessCB = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); assert_throws({name : exceptionName}, function () { handler.unregister(incorrectCallback, unregisterError); },exceptionName + " should be thrown - given incorrect success callback."); - handler.unregister(); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_unregisterServiceRecord.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_unregisterServiceRecord.html index b39c2dcf9..ec6ac7fdc 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_unregisterServiceRecord.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_unregisterServiceRecord.html @@ -44,12 +44,11 @@ Authors: //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:unregister M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html -//==== PRE Tests should be run separately //==== TEST_CRITERIA MOA setup({timeout: 90000}); -var adapter = null, t = async_test("BluetoothServiceHandler_unregister_unregisterServiceRecord", {timeout: 90000}), unregisterSuccess, unregisterError, - chatServiceSuccessCallback, powerOnSuccess, powerOnError, chatServiceErrorCallback; +var adapter = null, t = async_test("BluetoothServiceHandler_unregister_unregisterServiceRecord", {timeout: 90000}), unregisterSuccess, + unregisterError, chatServiceSuccessCallback, powerOnSuccess, powerOnError, chatServiceErrorCallback; t.step(function () { unregisterSuccess = t.step_func(function () { t.done(); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_errorCallback.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_errorCallback.html index 8c4e9a6b8..e5e41609a 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_errorCallback.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_errorCallback.html @@ -45,7 +45,6 @@ Authors: //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:unregister M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html -//==== PRE Tests should be run separately //==== TEST_CRITERIA MOA setup({timeout: 90000}); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_successCallback.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_successCallback.html index 55a234443..991ce0891 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_successCallback.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_successCallback.html @@ -36,7 +36,6 @@ Authors: //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:unregister M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html -//==== PRE Tests should be run separately //==== TEST_CRITERIA MOA setup({timeout: 90000}); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_uuid_attribute.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_uuid_attribute.html index 7f8676702..68434f8f1 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_uuid_attribute.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_uuid_attribute.html @@ -45,18 +45,18 @@ Authors: //==== ONLOAD_DELAY 90 //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceHandler:uuid A //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html -//==== PRE Tests should be run separately //==== TEST_CRITERIA AE AT ARO -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var t = async_test("BluetoothServiceHandler_uuid_attribute", {timeout:90000}); t.step(function () { var adapter, powerOnSuccess, powerOnError, chatServiceSuccessCallback, chatServiceErrorCallback, uuid; - chatServiceSuccessCallback = t.step_func(function (recordHandler) { - uuid = recordHandler.uuid; - check_readonly(recordHandler, "uuid", uuid, "string", "1234"); - recordHandler.unregister(); + chatServiceSuccessCallback = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); + uuid = handler.uuid; + check_readonly(handler, "uuid", uuid, "string", "1234"); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceSuccessCallback_onsuccess.html b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceSuccessCallback_onsuccess.html index fc73ae064..dd0cdae12 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceSuccessCallback_onsuccess.html +++ b/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceSuccessCallback_onsuccess.html @@ -37,19 +37,20 @@ Authors: //==== SPEC Tizen Web API:Communication:Bluetooth:BluetoothServiceSuccessCallback:onsuccess M //==== SPEC_URL https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/bluetooth.html //==== TEST_CRITERIA CBT CBOA -setup({timeout:90000}); +setup({timeout:90000, explicit_done:true}); var adapter = null,t = async_test("BluetoothServiceSuccessCallback_onsuccess", {timeout:90000}), chatServiceSuccessCB, chatServiceErrorCB, powerOnSuccess, powerOnError; t.step(function () { - chatServiceSuccessCB = t.step_func(function (recordHandler) { - assert_true("uuid" in recordHandler, "No uuid in socket"); - assert_true("name" in recordHandler, "No name in socket"); - assert_true("isConnected" in recordHandler, "No isConnected in socket"); - assert_true("onconnect" in recordHandler, "No onconnect in socket"); - assert_type(recordHandler.unregister, "function", "Method unregister does not exist."); - recordHandler.unregister(); + chatServiceSuccessCB = t.step_func(function (handler) { + setBluetoothHandlerCleanup(handler); + assert_true("uuid" in handler, "No uuid in socket"); + assert_true("name" in handler, "No name in socket"); + assert_true("isConnected" in handler, "No isConnected in socket"); + assert_true("onconnect" in handler, "No onconnect in socket"); + assert_type(handler.unregister, "function", "Method unregister does not exist."); + t.done(); }); diff --git a/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js b/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js index 1fa3ad67f..a53298163 100644 --- a/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js +++ b/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js @@ -46,6 +46,28 @@ var INVALID_BLUETOOTH_ADDRESS = [ null, undefined, 0, 1, "tizen", [1, 2, 3], {}, "35:00:00:00:03" ]; +function setBluetoothCleanup(obj, method) { + add_result_callback(function (res) { + if(obj && obj[method] && typeof obj[method] == "function") { + try { + obj[method](done,done); + } catch(e) { + done(); + } + } else { + done(); + } + }); +} + +function setBluetoothHandlerCleanup(handler) { + setBluetoothCleanup(handler, "unregister"); +} + +function setBluetoothDiscoveryCleanup(adapter) { + setBluetoothCleanup(adapter, "stopDiscovery"); +} + function check_bluetooth_device(device) { check_readonly(device, "name", device.name, "string", "new_name"); check_readonly(device, "address", device.address, "string", "new_address"); @@ -80,6 +102,10 @@ function check_bluetooth_device(device) { assert_type(device.connectToServiceByUUID, "function", "Method connectToServiceByUUID does not exist."); } +function check_bluetooth_device_array(devices) { + assert_type(devices, "array", "Devices has wrong type."); + assert_greater_than(devices.length, 0, "Bluetooth devices not found."); +} function onloaded() { try { diff --git a/tct-bluetooth-tizen-tests/tests.xml b/tct-bluetooth-tizen-tests/tests.xml index 6f27efc29..17e1975cb 100644 --- a/tct-bluetooth-tizen-tests/tests.xml +++ b/tct-bluetooth-tizen-tests/tests.xml @@ -57,7 +57,6 @@ - Tests should be run separately /opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_exist.html @@ -85,7 +84,6 @@ - Tests should be run separately /opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onerror.html @@ -123,7 +121,6 @@ - Tests should be run separately /opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_errorCallback.html @@ -267,19 +264,16 @@ - Tests should be run separately /opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_uuid_attribute.html - Tests should be run separately /opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_name_attribute.html - Tests should be run separately /opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_isConnected_attribute.html @@ -303,7 +297,6 @@ - Tests should be run separately /opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_unregisterServiceRecord.html @@ -1302,13 +1295,11 @@ - Tests should be run separately /opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister_with_successCallback.html - Tests should be run separately /opt/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_unregister.html