Bug 1323880 - Wait for the recording-window-ended notification instead of expecting it to happen before recording-device-events when reloading the page, r=past.
authorFlorian Quèze <florian@queze.net>
Mon, 06 Feb 2017 12:28:44 +0100
changeset 340872 b7f8236613d805aafb25c083b0af3efaa5fdf6aa
parent 340871 4ef7edd52783b92a265d79de5889b5508543fff1
child 340873 8475919c50b5e7874af3856ae8a8cc4778939102
push id86579
push userflorian@queze.net
push dateMon, 06 Feb 2017 11:30:43 +0000
treeherdermozilla-inbound@8475919c50b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs1323880
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1323880 - Wait for the recording-window-ended notification instead of expecting it to happen before recording-device-events when reloading the page, r=past.
browser/base/content/test/webrtc/browser_devices_get_user_media_screen.js
browser/base/content/test/webrtc/head.js
--- a/browser/base/content/test/webrtc/browser_devices_get_user_media_screen.js
+++ b/browser/base/content/test/webrtc/browser_devices_get_user_media_screen.js
@@ -316,17 +316,17 @@ var gTests = [
     yield checkSharingUI({audio: true, screen: "Screen"});
     yield closeStream();
   }
 },
 
 
 {
   desc: "getUserMedia screen: clicking through without selecting a screen denies",
-  run: function* checkReloading() {
+  run: function* checkClickThroughDenies() {
     let promise = promisePopupNotificationShown("webRTC-shareDevices");
     yield promiseRequestDevice(false, true, null, "screen");
     yield promise;
     yield expectObserverCalled("getUserMedia:request");
     checkDeviceSelectors(false, false, true);
 
     yield promiseMessage(permissionError, () => {
       PopupNotifications.panel.firstChild.button.click();
--- a/browser/base/content/test/webrtc/head.js
+++ b/browser/base/content/test/webrtc/head.js
@@ -402,22 +402,24 @@ function* closeStream(aAlreadyClosed, aF
   if (promises)
     yield Promise.all(promises);
 
   yield* assertWebRTCIndicatorStatus(null);
 }
 
 function* reloadAndAssertClosedStreams() {
   info("reloading the web page");
-  let promise = promiseObserverCalled("recording-device-events");
+  let promises = [
+    promiseObserverCalled("recording-device-events"),
+    promiseObserverCalled("recording-window-ended")
+  ];
   yield ContentTask.spawn(gBrowser.selectedBrowser, null,
                           "() => content.location.reload()");
-  yield promise;
+  yield Promise.all(promises);
 
-  yield expectObserverCalled("recording-window-ended");
   yield expectNoObserverCalled();
   yield checkNotSharing();
 }
 
 function checkDeviceSelectors(aAudio, aVideo, aScreen) {
   let micSelector = document.getElementById("webRTC-selectMicrophone");
   if (aAudio)
     ok(!micSelector.hidden, "microphone selector visible");