Bug 1312234 - Wait for gUM capture messages when tearing off a tab. r?florian
MozReview-Commit-ID: CaCt5C1whHw
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_tear_off_tab.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_tear_off_tab.js
@@ -44,20 +44,22 @@ var gTests = [
ok(gIdentityHandler._identityPopup.hidden,
"control center should be hidden in the first window");
win.gIdentityHandler._identityPopup.hidden = true;
// Closing the new window should remove all sharing indicators.
// We need to load the content script in the first window so that we can
// catch the notifications fired globally when closing the second window.
gBrowser.selectedBrowser.messageManager.loadFrameScript(CONTENT_SCRIPT_HELPER, true);
- yield BrowserTestUtils.closeWindow(win);
- yield expectObserverCalled("recording-window-ended");
- yield expectObserverCalled("recording-device-events");
+ let promises = [promiseObserverCalled("recording-device-events"),
+ promiseObserverCalled("recording-window-ended")];
+ yield BrowserTestUtils.closeWindow(win);
+ yield Promise.all(promises);
+
yield expectNoObserverCalled();
yield checkNotSharing();
}
}
];
function test() {