Bug 972730 - Avoid disabling BT before the BT adapter is initialized in marionette...
commit98714c3135c029e242cc9e1ca0b083e33f33fcfe
authorJamin Liu <jaliu@mozilla.com>
Mon, 3 Mar 2014 15:20:24 +0000 (3 10:20 -0500)
committerJamin Liu <jaliu@mozilla.com>
Mon, 3 Mar 2014 15:20:24 +0000 (3 10:20 -0500)
treed809c00847eda8f61c14f2f2be8cfebe1dda523b
parentc26e3d45984e33772384c56d79d8ef41f4a64996
Bug 972730 - Avoid disabling BT before the BT adapter is initialized in marionette test. r=echou, f=vicamo

The current Bluetooth API can't allow user to disable BT before the BT
adapter is initialized.
In practice, We block the clicking event in gaia layer to prevent user
to turn off BT before BT enable procedure complete.
If we use marionette test to force emulator turn on and turn off BT in
a short period of time, it may crash emulator.

Listen to 'adapteradded' event rather than 'enabled' as the end of
BT enable to make sure we wouldn't disable BT when it's not ready.
dom/bluetooth/tests/marionette/test_dom_BluetoothManager_enabled.js