Bug 1312234 - Wait for gUM capture messages when tearing off a tab. r=florian
authorAndreas Pehrson <pehrsons@gmail.com>
Mon, 24 Oct 2016 16:25:27 +0200
changeset 319711 2199f815eaa9478cc781bed08291162f20e59bd5
parent 319710 3e8ddc7e657519e979f374c1a97e2aec4c97505d
child 319712 1ba26e18f7cabe9f232780081d8b66366c7ddef4
push id20748
push userphilringnalda@gmail.com
push dateFri, 28 Oct 2016 03:39:55 +0000
treeherderfx-team@715360440695 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1312234
milestone52.0a1
Bug 1312234 - Wait for gUM capture messages when tearing off a tab. r=florian MozReview-Commit-ID: CaCt5C1whHw
browser/base/content/test/webrtc/browser_devices_get_user_media_tear_off_tab.js
--- 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() {