[Bluetooth] ondevicedisappeared
authorWitold Choinkowski <w.choinkowsk@samsung.com>
Wed, 25 Sep 2013 15:49:47 +0000 (17:49 +0200)
committerWitold Choinkowski <w.choinkowsk@samsung.com>
Wed, 25 Sep 2013 15:49:47 +0000 (17:49 +0200)
Change-Id: Ic20ff9ae5683cdbc24375933372dbc25d4d380f4

tct-bluetooth-tizen-tests/bluetooth/BluetoothDiscoverDevicesSuccessCallback_ondevicedisappeared.html

index 70e174f27f47b23f0c9507acd1b41a766a86c91f..526314f9ca58fde7ec17db0a6303a78874522abc 100644 (file)
@@ -57,11 +57,15 @@ t.step(function () {
         }),
         ondevicedisappeared: t.step_func(function (address) {
             assert_type(address, "string", "address has wrong type");
-            flag = true;
+            if(address === REMOTE_DEVICE_ADDRESS)
+                flag = true;
         }),
         onfinished: t.step_func(function (devices) {
-            assert_true(flag, "Device not dissapeared");
-            t.done();
+            if(flag) {
+                t.done();
+            } else {
+                adapter.discoverDevices(discoverDevicesSuccessTwoCB,discoverDevicesErrorCB);
+            }
         })
     };
 
@@ -74,10 +78,8 @@ t.step(function () {
         }),
         onfinished: t.step_func(function (devices) {
             if (devices.length !== 0 ){
+                adapter.discoverDevices(discoverDevicesSuccessTwoCB,discoverDevicesErrorCB);
                 alert("Please disable bluetooth on other device");
-                setTimeout(function (){
-                    adapter.discoverDevices(discoverDevicesSuccessTwoCB,discoverDevicesErrorCB);
-                },5000);
             } else {
                 assert_unreached("No devices was found");
             }