}),
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);
+ }
})
};
}),
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");
}