From: Arkadiusz Pietraszek Date: Wed, 4 Mar 2020 12:05:34 +0000 (+0100) Subject: [bluetooth] Adding bond cleanup after manual tests X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d7ef3681fdce43da5a43520fac36adb7067aac8;p=test%2Ftct%2Fweb%2Fapi.git [bluetooth] Adding bond cleanup after manual tests When tests are run on odroid(xu3) device with bluetooth adapter attached via usb, destroying bond after each test case significantly speeds up process of testing. https://code.sec.samsung.net/jira/browse/XWALK-2081 [Verification] TCT pass rate 100% on mobile device. 1 test case fails on odroid, waiting for fix. Change-Id: I75296ca5a76256fec1842e61d064273bc8d82cbe Signed-off-by: Arkadiusz Pietraszek (cherry picked from commit 7e7993f719bd2cff159144b18f010c15a0c93617) --- diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding.html index 5fc143a13..207233120 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding.html @@ -1,7 +1,7 @@ @@ -44,11 +45,15 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), createBondingSuccess, powerOnSuccess, retValue = null; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + createBondingSuccess = t.step_func(function (device) { check_bluetooth_device(device); assert_equals(retValue, undefined, "createBonding returns wrong value"); t.done(); - }); powerOnSuccess = t.step_func(function () { diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_bondingDevice.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_bondingDevice.html index 927bac41d..c81f7b666 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_bondingDevice.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_bondingDevice.html @@ -1,32 +1,34 @@ @@ -54,6 +56,10 @@ var adapter = null, t = async_test(document.title, {timeout: 180000}), discoverD stopDiscoverySuccess; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + discoverDevicesSuccessCallback = { onstarted: t.step_func (function () { }), @@ -62,7 +68,7 @@ t.step(function () { ondevicedisappeared: t.step_func (function (address) { }), onfinished: t.step_func (function (devices) { - if (devices.length > 0) { + if (devices.length > 0) { adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError); } else { setTimeout(setstopDiscoverySuccess, 1000); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_deviceaddress_correct.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_deviceaddress_correct.html index 553b41f3b..ddda24f10 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_deviceaddress_correct.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_deviceaddress_correct.html @@ -1,6 +1,7 @@ @@ -52,6 +54,10 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingError, onBondingSuccess; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onBondingSuccess = t.step_func(function (device) { assert_equals(device.address, REMOTE_DEVICE_ADDRESS, "device address in onBondingSuccess"); t.done(); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_devicebonded.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_devicebonded.html index 6b1c7ae67..b539e3e0a 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_devicebonded.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_devicebonded.html @@ -1,6 +1,7 @@ @@ -52,6 +54,10 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingError, onBondingSuccess; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onBondingSuccess = t.step_func(function (device) { assert_equals(device.address, REMOTE_DEVICE_ADDRESS, "device address in onBondingSuccess"); t.done(); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_devicename_correct.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_devicename_correct.html index a40b35e00..e56c1a6cd 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_devicename_correct.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_devicename_correct.html @@ -1,6 +1,7 @@ @@ -53,6 +55,10 @@ setup({timeout: 180000}); var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingError, onBondingSuccess; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onBondingSuccess = t.step_func(function (device) { assert_equals(device.name, REMOTE_DEVICE_NAME, "device name in onBondingSuccess"); t.done(); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_deviceuuid_correct.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_deviceuuid_correct.html index dcfd17c96..e864f6ba7 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_deviceuuid_correct.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_deviceuuid_correct.html @@ -1,6 +1,7 @@ @@ -54,6 +56,10 @@ var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, message = "UUIDs: \n", i; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onBondingSuccess = t.step_func(function (device) { for(i = 0; i < device.uuids.length; i ++) { message += device.uuids[i] + " \n"; diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_with_errorCallback.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_with_errorCallback.html index a354e44d2..cd6863b96 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_with_errorCallback.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_with_errorCallback.html @@ -1,6 +1,7 @@ @@ -53,6 +55,11 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), createBondingSuccess, createBondingError, powerOnSuccess; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + createBondingSuccess = t.step_func(function (device) { check_bluetooth_device(device); t.done(); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_errorCallback_TypeMismatch.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_errorCallback_TypeMismatch.html index c0a825afd..31fb34365 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_errorCallback_TypeMismatch.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_errorCallback_TypeMismatch.html @@ -1,7 +1,7 @@ @@ -44,6 +45,11 @@ var t = async_test(document.title, {timeout: 180000}), adapter, exceptionName, i, successCallback, errorCallback, onBondingSuccess, onBondingError, powerOnSuccess, conversionTable = getTypeConversionExceptions("functionObject", true); t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + successCallback = t.step_func(function () { assert_unreached("Method destroyBonding shouldn't end successfully."); }); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_errorCallback_invalid_cb.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_errorCallback_invalid_cb.html index 11605fe4b..ec6e05127 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_errorCallback_invalid_cb.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_errorCallback_invalid_cb.html @@ -1,7 +1,7 @@ @@ -45,6 +46,10 @@ var t = async_test(document.title, {timeout: 180000}), onBondingSuccess, onBondingError, powerOnSuccess; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + incorrectCallback = { onerror: t.step_func(function (e) { assert_unreached("Invalid errorCallback invoked: " + e.name + ": " + e.message); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_successCallback_TypeMismatch.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_successCallback_TypeMismatch.html index 8cc3c41d4..21748939d 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_successCallback_TypeMismatch.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_successCallback_TypeMismatch.html @@ -1,7 +1,7 @@ @@ -43,6 +44,11 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), exceptionName, i, conversionTable, errorCallback, onBondingSuccess, onBondingError, powerOnSuccess, successCallback; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + conversionTable = getTypeConversionExceptions("functionObject", true); errorCallback = t.step_func(function (e) { diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_successCallback_invalid_cb.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_successCallback_invalid_cb.html index 9f82326ba..3b2f6082f 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_successCallback_invalid_cb.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_successCallback_invalid_cb.html @@ -1,7 +1,7 @@ @@ -44,6 +45,10 @@ var adapter = null, t = async_test(document.title, {timeout: 180000}), exception incorrectCallback, destroyBondingError, onBondingSuccess, onBondingSuccess, onBondingError, powerOnSuccess; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + incorrectCallback = { onsuccess: t.step_func(function () { assert_unreached("Method destroyBonding shouldn't end successfully."); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_with_errorCallback.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_with_errorCallback.html index e703efb32..72ebc33d1 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_with_errorCallback.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_with_errorCallback.html @@ -1,6 +1,7 @@ @@ -52,6 +54,11 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), successCallback, errorCallback, onBondingSuccess, onBondingError, powerOnSuccess; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + successCallback = t.step_func(function () { t.done(); }); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_with_successCallback.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_with_successCallback.html index 23770430b..1bf138acb 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_with_successCallback.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_destroyBonding_with_successCallback.html @@ -1,7 +1,7 @@ @@ -44,6 +45,11 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), onBondingSuccess, onBondingError, powerOnSuccess, gotDeviceInfo, retValue = null; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + gotDeviceInfo = t.step_func(function (device) { check_bluetooth_device(device); assert_equals(retValue, undefined, "Argument getDevice returns wrong value."); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_getDevice_with_errorCallback.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_getDevice_with_errorCallback.html index f09f970d8..ae0058c7d 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_getDevice_with_errorCallback.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_getDevice_with_errorCallback.html @@ -1,6 +1,7 @@ @@ -54,6 +56,11 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), gotDeviceInfo, gotDeviceError, onBondingSuccess, onBondingError; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + gotDeviceInfo = t.step_func(function (device) { check_bluetooth_device(device); t.done(); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onconnect_successful.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onconnect_successful.html index 7bd55cbba..bae6b35da 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onconnect_successful.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_registerRFCOMMServiceByUUID_onconnect_successful.html @@ -1,6 +1,7 @@ @@ -62,6 +64,10 @@ var adapter = null, t = async_test(document.title, {timeout: 180000}), registerRFCOMMServiceByUUIDSuccess, registerRFCOMMServiceByUUIDError, visibleSuccess, visibleError; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + registerRFCOMMServiceByUUIDSuccess = t.step_func(function (handler) { setBluetoothHandlerCleanup(handler); handler.onconnect = t.step_func(function (socket) { diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothClass.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothClass.html index c0a707abb..6d0348029 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothClass.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothClass.html @@ -1,7 +1,7 @@ @@ -57,7 +58,13 @@ var t = async_test(document.title, {timeout: 180000}), adapter, gotDeviceInfo, g onBondingSuccess, onBondingError, powerOnSuccess, minor, major, devService; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + gotDeviceInfo = t.step_func(function (device) { + //BluetoothClass_attribute AT test(function () { assert_type(device.name, "string", "Device name type check:"); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothClass_hasService.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothClass_hasService.html index 1d2a82fc5..a066390c2 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothClass_hasService.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothClass_hasService.html @@ -1,6 +1,7 @@ @@ -53,6 +55,11 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), gotDeviceInfo, gotDeviceError, onBondingSuccess, onBondingError, powerOnSuccess; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + gotDeviceInfo = t.step_func(function (device) { if (device.deviceClass.services.length > 0){ assert_true(device.deviceClass.hasService(device.deviceClass.services[0]), "hasService in gotDeviceInfo"); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice.html index 41379c99a..c109c6733 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice.html @@ -1,7 +1,7 @@ @@ -71,6 +72,11 @@ var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, successCallback, exceptionName = "TypeMismatchError", conversionTable, conversionErrorCallback, conversionSuccessCallback, incorrectSuccessCallback, incorrectErrorCallback, successCallback, errorCallback, deviceClassCP, fakeDeviceClass, devUuid, i; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + incorrectSuccessCallback = { onsuccess: t.step_func(function () { assert_unreached("Invalid successCallback invoked"); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID.html index 1bbf8b994..67abe2956 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID.html @@ -1,6 +1,7 @@ @@ -53,6 +55,11 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketConnect, onBondingSuccess, onBondingError, powerOnSuccess, retValue = null; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { if(socket.state === "OPEN"){ assert_equals(retValue, undefined, "connectToServiceByUUID returns wrong value"); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID_onerror.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID_onerror.html index e919504dc..98af9bfaf 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID_onerror.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID_onerror.html @@ -1,32 +1,34 @@ @@ -52,6 +54,11 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketConnect, onBondingSuccess, onBondingError, powerOnSuccess, onSocketError; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { assert_unreached("Shouldn't be here"); }); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID_with_errorCallback.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID_with_errorCallback.html index 80b109aac..2a16e1a0f 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID_with_errorCallback.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothDevice_connectToServiceByUUID_with_errorCallback.html @@ -1,7 +1,7 @@ @@ -43,6 +44,11 @@ setup({timeout: 180000}); var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketConnect, onSocketError, onBondingSuccess, onBondingError, powerOnSuccess; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { if(socket.state === "OPEN") { t.done(); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_onconnect_attribute.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_onconnect_attribute.html index 80ed13b91..bae85d044 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_onconnect_attribute.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothServiceHandler_onconnect_attribute.html @@ -1,7 +1,7 @@ @@ -55,6 +56,11 @@ setup({timeout:180000, explicit_done:true}); var t = async_test(document.title, {timeout: 180000}), adapter, onError, testMessage, registerSuccessCallback, sendMsg, serviceHandler, data, recvmsg, checkmsg, i, expectedMsgFromClient, sendMsgData, msgToClient; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onError = t.step_func(function (e) { assert_unreached("errorCallback arrived:" + e.message); }); @@ -101,7 +107,7 @@ t.step(function () { document.getElementById("testdetails").style["display"] = ""; }); adapter = tizen.bluetooth.getDefaultAdapter(); - adapter.registerRFCOMMServiceByUUID(CHAT_SERVICE_UUID, "Chat service", registerSuccessCallback, onError); + adapter.registerRFCOMMServiceByUUID(CHAT_SERVICE_UUID, "Chat service", registerSuccessCallback, onError); }); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket.html index 1349a8cb5..4606d53ba 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket.html @@ -1,7 +1,7 @@ @@ -75,6 +76,11 @@ var t = async_test(document.title, {timeout: 180000}), adapter, onSocketConnect, gotDeviceInfo, gotDeviceError, onBondingSuccess, onBondingError, powerOnSuccess, peerCP, fakePeer, skState, skUuid, param, i; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { //BluetoothSocket_close_exist ME test(function () { diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocketState_open_enum.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocketState_open_enum.html index a190cfa2c..4065bce17 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocketState_open_enum.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocketState_open_enum.html @@ -1,6 +1,7 @@ @@ -53,6 +55,10 @@ var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { assert_equals(socket.state, "OPEN", "BluetoothSocket.state enum is no equal to 'OPEN'"); socket.close(); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_close.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_close.html index 0a41930aa..d52036f44 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_close.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_close.html @@ -1,7 +1,7 @@ @@ -44,6 +45,10 @@ var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketC gotDeviceInfo, gotDeviceError, onBondingSuccess, onBondingError, powerOnSuccess, retValue = null; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { retValue = socket.close(); socket.onclose = t.step_func(function () { diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onclose_callback.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onclose_callback.html index 4ceaa0555..41ea9f5c0 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onclose_callback.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onclose_callback.html @@ -1,32 +1,34 @@ @@ -60,6 +62,11 @@ var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, gotDeviceInfo, gotDeviceError, onSocketConnect, onSocketError; t.step(function () { + + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { socket.onmessage = t.step_func(function () { }); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onmessage_callback.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onmessage_callback.html index 2e1b6adfd..5b92eecf4 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onmessage_callback.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onmessage_callback.html @@ -1,32 +1,34 @@ @@ -54,6 +56,10 @@ var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { socket.onmessage = t.step_func(function () { socket.close(); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_readData.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_readData.html index 54e710630..270f33c90 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_readData.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_readData.html @@ -1,6 +1,7 @@ @@ -54,6 +56,10 @@ var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketC onSocketConnectedError, gotDeviceInfo, gotDeviceError, onBondingSuccess, onBondingError, powerOnSuccess; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { socket.onmessage = t.step_func(function () { retValue = socket.readData(); diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_writeData.html b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_writeData.html index 1e787df0b..a4d53ac08 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_writeData.html +++ b/common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_writeData.html @@ -1,6 +1,7 @@ @@ -52,6 +54,10 @@ var adapter = null, t = async_test(document.title, {timeout: 180000}), onSocketC onBondingError, powerOnSuccess, textmsg = "Test", sendtextmsg = [], byteData, i; t.step(function () { + add_result_callback(function() { + clearBonding(REMOTE_DEVICE_ADDRESS); + }); + onSocketConnect = t.step_func(function (socket) { for (i = 0; i < textmsg.length; i ++) { diff --git a/common/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js b/common/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js index 766963ecc..680e8e4a6 100755 --- a/common/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js +++ b/common/tct-bluetooth-tizen-tests/bluetooth/support/bluetooth_common.js @@ -1,6 +1,6 @@ /* -Copyright (c) 2013 Samsung Electronics Co., Ltd. +Copyright (c) 2013 Samsung Electronics Co., Ltd. All Rights Reserved Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ 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: + Unknown Samsung Engineer(s) + Arkadiusz Pietraszek */ @@ -370,4 +370,8 @@ function assertTypeMismatch(t, e) { assert_unreached("uagent search not found:" + e.message); } } + +function clearBonding(deviceAddress) { + tizen.bluetooth.getDefaultAdapter().destroyBonding(deviceAddress); +} // Add common apis from Xi'an end