mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1041155 - The browser_wa_properties-view-media-nodes.js test doesn't wait for the audio device to be actually closed, r=paul.
This commit is contained in:
parent
aba751a27d
commit
6ceb2243eb
@ -8,6 +8,30 @@
|
||||
|
||||
let MEDIA_PERMISSION = "media.navigator.permission.disabled";
|
||||
|
||||
function waitForDeviceClosed() {
|
||||
info("Checking that getUserMedia streams are no longer in use.");
|
||||
|
||||
let temp = {};
|
||||
Cu.import("resource:///modules/webrtcUI.jsm", temp);
|
||||
let webrtcUI = temp.webrtcUI;
|
||||
|
||||
if (!webrtcUI.showGlobalIndicator)
|
||||
return Promise.resolve();
|
||||
|
||||
let deferred = Promise.defer();
|
||||
|
||||
const TOPIC = "recording-device-events";
|
||||
Services.obs.addObserver(function deviceEventsObserver() {
|
||||
info("Observing " + TOPIC);
|
||||
if (!webrtcUI.showGlobalIndicator) {
|
||||
Services.obs.removeObserver(deviceEventsObserver, TOPIC);
|
||||
deferred.resolve();
|
||||
}
|
||||
}, TOPIC, false);
|
||||
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
function spawnTest() {
|
||||
let [target, debuggee, panel] = yield initWebAudioEditor(MEDIA_NODES_URL);
|
||||
let { panelWin } = panel;
|
||||
@ -41,5 +65,8 @@ function spawnTest() {
|
||||
Services.prefs.setBoolPref(MEDIA_PERMISSION, mediaPermissionPref);
|
||||
|
||||
yield teardown(panel);
|
||||
|
||||
yield waitForDeviceClosed();
|
||||
|
||||
finish();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user