Bug 1126107 - Intermittent browser_devices_get_user_media.js | WebRTC indicator hidden - Got true, expected false. r=Gijs, a=test-only
authorFlorian Quèze <florian@queze.net>
Mon, 13 Apr 2015 16:04:53 +0200
changeset 260234 8d4a0b33d32e
parent 260233 fe8c5e74565f
child 260235 71d1d59db847
push id724
push userryanvm@gmail.com
push date2015-04-23 01:08 +0000
treeherdermozilla-release@db41e8e267ed [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, test-only
bugs1126107
milestone38.0
Bug 1126107 - Intermittent browser_devices_get_user_media.js | WebRTC indicator hidden - Got true, expected false. r=Gijs, a=test-only
browser/base/content/test/general/head.js
--- a/browser/base/content/test/general/head.js
+++ b/browser/base/content/test/general/head.js
@@ -653,16 +653,22 @@ function promiseWindow(url) {
     }, "domwindowopened", false);
   });
 }
 
 function assertWebRTCIndicatorStatus(expected) {
   let ui = Cu.import("resource:///modules/webrtcUI.jsm", {}).webrtcUI;
   let expectedState = expected ? "visible" : "hidden";
   let msg = "WebRTC indicator " + expectedState;
+  if (!expected && ui.showGlobalIndicator) {
+    // It seems the global indicator is not always removed synchronously
+    // in some cases.
+    info("waiting for the global indicator to be hidden");
+    yield promiseWaitForCondition(() => !ui.showGlobalIndicator);
+  }
   is(ui.showGlobalIndicator, !!expected, msg);
 
   let expectVideo = false, expectAudio = false, expectScreen = false;
   if (expected) {
     if (expected.video)
       expectVideo = true;
     if (expected.audio)
       expectAudio = true;