[tv][bluetooth]update 1 tc to fix DF250116-01301 25/318625/2
authorchen <chen89.chen@samsung.com>
Tue, 21 Jan 2025 08:39:51 +0000 (16:39 +0800)
committerchen chen <chen89.chen@samsung.com>
Tue, 21 Jan 2025 08:43:37 +0000 (08:43 +0000)
@pre The remote device must be discoverable with bt_adapter_start_device_discovery().
int bt_device_create_bond(const char *remote_address);
error case: no info for peer device -> ble scan (get the adertisement from peer)  by tap view appication (BLE_ONLY) -> create bond -> ble bond
Change-Id: I4b5048844ae785e194730fcc77b290c85787f759
Signed-off-by: chen <chen89.chen@samsung.com>
common/tct-bluetooth-tizen-tests/bluetooth/BluetoothSocket_onclose_callback.html
common/tct-bluetooth-tizen-tests/tct-bt-helper/config.xml

index 19b0731bacd17ee0e6393d8750a7b92c190f51e5..5ccdddd26e3fa895a47ca02dc79f945647773ace 100755 (executable)
@@ -59,7 +59,7 @@ Authors:
 
 setup({timeout: 180000});
 var t = async_test(document.title, {timeout: 180000}), adapter, powerOnSuccess, onBondingSuccess, onBondingError,
-    gotDeviceInfo, gotDeviceError, onSocketConnect, onSocketError, flag = false;
+    gotDeviceInfo, gotDeviceError, onSocketConnect, onSocketError, flag = false, found = false;
 
 t.step(function () {
     if (BT_SUPPORT) { // network.bluetooth support
@@ -106,12 +106,49 @@ t.step(function () {
             assert_unreached("onBondingError exception:" + e.message);
         });
 
-        powerOnSuccess = t.step_func(function () {
-            adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError);
+        stopDiscoverySuccess1 = t.step_func(function () {
+            console.log("stopDiscoverySuccess1");
+        });
+
+        discoverDevicesSuccessCallback = {
+            onstarted: t.step_func(function () {
+            }),
+            ondevicefound: t.step_func(function (device) {
+                if (device.address === REMOTE_DEVICE_ADDRESS) {
+                    stopDiscovery(t, adapter, stopDiscoverySuccess1);
+                    adapter.createBonding(REMOTE_DEVICE_ADDRESS, onBondingSuccess, onBondingError)
+                }
+            }),
+            ondevicedisappeared: t.step_func(function (address) {
+            }),
+            onfinished: t.step_func(function (devices) {
+                if (devices.length > 0) {
+                    found = false;
+                    for (var i = 0; i < devices.length; i++) {
+                        if (devices[i].address === REMOTE_DEVICE_ADDRESS) {
+                            found = true;
+                            break;
+                        }
+                    }
+                    if (found === false) {
+                        assert_unreached("Device not found:" + REMOTE_DEVICE_ADDRESS);
+                    }
+                } else {
+                    setTimeout(stopDiscoverySuccess, 1000);
+                }
+            })
+        };
+
+        discoverDevicesError = t.step_func(function (e) {
+            assert_unreached("discoverDevicesError exception:" + e.message);
+        });
+
+        stopDiscoverySuccess = t.step_func(function () {
+            adapter.discoverDevices(discoverDevicesSuccessCallback, discoverDevicesError);
         });
 
         adapter = tizen.bluetooth.getDefaultAdapter();
-        setPowered(t, adapter, powerOnSuccess);
+        stopDiscovery(t, adapter, stopDiscoverySuccess);
 
     } else {
         t.done();
index 8420b09d3f982bf0388ea1cecd5aa0d06095d14f..f95c1cfdcceda250939ca39ca221e4e0c53a9ff4 100755 (executable)
@@ -6,4 +6,5 @@
     <name>tct-bt-helper</name>
     <tizen:privilege name="http://tizen.org/privilege/bluetooth"/>
     <tizen:privilege name="http://tizen.org/privilege/telephony"/>
+    <tizen:setting pointing-device-support="enable"/>
 </widget>