[tv][bluetooth]DF241203-01904 createBonding_bondingDevice reduce run time 28/316328/1
authorchen <chen89.chen@samsung.com>
Fri, 13 Dec 2024 18:23:08 +0000 (02:23 +0800)
committerchen <chen89.chen@samsung.com>
Fri, 13 Dec 2024 18:23:16 +0000 (02:23 +0800)
Change-Id: I448a455648c89fbe9928540f3fea2e2f34863b71
Signed-off-by: chen <chen89.chen@samsung.com>
common/tct-bluetooth-tizen-tests/bluetooth/BluetoothAdapter_createBonding_bondingDevice.html

index df200947c5e7bea867841b3d6f53edb60197aef5..8e006684c3e893adb16416b9415279019db2d029 100755 (executable)
@@ -64,6 +64,9 @@ t.step(function () {
             onstarted: t.step_func(function () {\r
             }),\r
             ondevicefound: t.step_func(function (device) {\r
+                if (device.address === REMOTE_DEVICE_ADDRESS) {\r
+                    stopDiscovery(t, adapter, stopDiscoverySuccess1);\r
+                }\r
             }),\r
             ondevicedisappeared: t.step_func(function (address) {\r
             }),\r
@@ -71,7 +74,7 @@ t.step(function () {
                 if (devices.length > 0) {\r
                     adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);\r
                 } else {\r
-                    setTimeout(setstopDiscoverySuccess, 1000);\r
+                    setTimeout(stopDiscoverySuccess, 1000);\r
                 }\r
             })\r
         };\r
@@ -96,6 +99,9 @@ t.step(function () {
             assert_unreached("discoverDevicesError exception:" + e.message);\r
         });\r
 \r
+        stopDiscoverySuccess1 = t.step_func(function () {\r
+            console.log("stopDiscoverySuccess1");\r
+        });\r
         stopDiscoverySuccess = t.step_func(function () {\r
             adapter.discoverDevices(discoverDevicesSuccessCallback, discoverDevicesError);\r
         });\r