Bug 1332516 - Fix Intermittent browser_devices_get_user_media_unprompted_access_tear_off_tab.js. r=florian, a=test-only
authorMunro Mengjue Chiang <mchiang@mozilla.com>
Mon, 23 Jan 2017 14:49:34 +0800
changeset 375693 c748e16d9ec7918ee2877a1986b058cf5aa98b86
parent 375692 86c2de8ec8d1741d9fa27cb8707bfd8248d5d1e0
child 375694 8575918c999ce963225bdcd0aa763b91e7500253
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, test-only
bugs1332516
milestone53.0a2
Bug 1332516 - Fix Intermittent browser_devices_get_user_media_unprompted_access_tear_off_tab.js. r=florian, a=test-only MozReview-Commit-ID: LRVpMwGl6Ev
browser/base/content/test/webrtc/browser_devices_get_user_media_unprompted_access_tear_off_tab.js
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_unprompted_access_tear_off_tab.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_unprompted_access_tear_off_tab.js
@@ -34,23 +34,24 @@ var gTests = [
     yield whenDelayedStartupFinished(win);
     yield checkSharingUI({audio: true, video: true}, win);
 
     gBrowser.selectedBrowser.messageManager.loadFrameScript(CONTENT_SCRIPT_HELPER, true);
 
     info("request audio+video and check if there is no prompt");
     yield promiseRequestDevice(true, true, null, null, win.gBrowser.selectedBrowser);
     yield promiseObserverCalled("getUserMedia:request");
-    yield promiseNoPopupNotification("webRTC-shareDevices");
-    yield expectObserverCalled("getUserMedia:response:allow");
-    yield expectObserverCalled("recording-device-events");
+    let promises = [promiseNoPopupNotification("webRTC-shareDevices"),
+                    promiseObserverCalled("getUserMedia:response:allow"),
+                    promiseObserverCalled("recording-device-events")];
+    yield Promise.all(promises);
 
-    let promises = [promiseObserverCalled("recording-device-events"),
-                    promiseObserverCalled("recording-device-events"),
-                    promiseObserverCalled("recording-window-ended")];
+    promises = [promiseObserverCalled("recording-device-events"),
+                promiseObserverCalled("recording-device-events"),
+                promiseObserverCalled("recording-window-ended")];
     yield BrowserTestUtils.closeWindow(win);
     yield Promise.all(promises);
 
     yield checkNotSharing();
   }
 }
 
 ];