mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1139774 - Add a function to wait promise for bluetooth adapter creation. r=shuang
This commit is contained in:
parent
4174446530
commit
3db4451175
@ -837,6 +837,10 @@ function cleanUp() {
|
||||
|
||||
function startBluetoothTestBase(aPermissions, aTestCaseMain) {
|
||||
ensureBluetoothManager(aPermissions)
|
||||
.then(function() {
|
||||
log("Wait for creating bluetooth adapter...");
|
||||
return waitForManagerStateChanged(bluetoothManager);
|
||||
})
|
||||
.then(aTestCaseMain)
|
||||
.then(cleanUp, function() {
|
||||
ok(false, "Unhandled rejected promise.");
|
||||
@ -885,3 +889,22 @@ function startBluetoothTest(aReenable, aTestCaseMain) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function waitForManagerStateChanged(aManager) {
|
||||
let deferred = Promise.defer();
|
||||
|
||||
aManager.onattributechanged = function(evt) {
|
||||
for (var i in evt.attrs) {
|
||||
switch (evt.attrs[i]) {
|
||||
case 'defaultAdapter':
|
||||
deferred.resolve(evt);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
|
@ -6,15 +6,21 @@ qemu = false
|
||||
# Hint: "disabled = xxxxx" statement should be added *below* the test that
|
||||
# we want to disable.
|
||||
|
||||
[test_dom_BluetoothManager_API2.js]
|
||||
[test_dom_BluetoothManager.js]
|
||||
disabled = Bug 1175389
|
||||
[test_dom_BluetoothAdapter_enable_API2.js]
|
||||
|
||||
[test_dom_BluetoothAdapter_enable.js]
|
||||
disabled = Bug 1175389
|
||||
[test_dom_BluetoothAdapter_setters_API2.js]
|
||||
|
||||
[test_dom_BluetoothAdapter_setters.js]
|
||||
disabled = Bug 1175389
|
||||
[test_dom_BluetoothAdapter_discovery_API2.js]
|
||||
|
||||
[test_dom_BluetoothDevice.js]
|
||||
disabled = Bug 1175389
|
||||
[test_dom_BluetoothDevice_API2.js]
|
||||
|
||||
[test_dom_BluetoothAdapter_discovery.js]
|
||||
disabled = Bug 1175389
|
||||
[test_dom_BluetoothAdapter_pair_API2.js]
|
||||
|
||||
[test_dom_BluetoothAdapter_pair.js]
|
||||
disabled = Bug 1175389
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user