Bug 1320994 - Increase retries for screensharing preview window. r=florian
authorAndreas Pehrson <pehrsons@gmail.com>
Wed, 03 May 2017 22:58:40 +0200
changeset 356889 1fb2d6e0aa2d82c2db246ecd75f7225fecc449ed
parent 356888 d34041d4dfe96a6872d2c4a569e0c428fa91a371
child 356890 7a2fb60f21ad7d2f6b06bad7f6e8b87c459dad7c
push id31775
push userihsiao@mozilla.com
push dateMon, 08 May 2017 03:10:38 +0000
treeherdermozilla-central@22aaf8bad4df [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1320994
milestone55.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 1320994 - Increase retries for screensharing preview window. r=florian MozReview-Commit-ID: IPnLWPT8SNP
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
@@ -50,17 +50,17 @@ var gTests = [
       is(item.getAttribute("devicetype"), "Screen", "the devicetype attribute is set correctly");
       ok(item.scary, "the screen item is marked as scary");
     }
 
     // Select a screen, a preview with a scary warning should appear.
     menulist.getItemAtIndex(2).doCommand();
     ok(!document.getElementById("webRTC-all-windows-shared").hidden,
        "the 'all windows will be shared' warning should now be visible");
-    yield promiseWaitForCondition(() => !document.getElementById("webRTC-preview").hidden);
+    yield promiseWaitForCondition(() => !document.getElementById("webRTC-preview").hidden, 100);
     ok(!document.getElementById("webRTC-preview").hidden,
        "the preview area is visible");
     ok(!document.getElementById("webRTC-previewWarning").hidden,
        "the scary warning is visible");
 
     // Select the 'No Screen' item again, the preview should be hidden.
     menulist.getItemAtIndex(0).doCommand();
     ok(document.getElementById("webRTC-all-windows-shared").hidden,
--- a/browser/base/content/test/webrtc/head.js
+++ b/browser/base/content/test/webrtc/head.js
@@ -25,19 +25,19 @@ function waitForCondition(condition, nex
     if (conditionPassed) {
       moveOn();
     }
     tries++;
   }, 100);
   var moveOn = function() { clearInterval(interval); nextTest(); };
 }
 
-function promiseWaitForCondition(aConditionFn) {
+function promiseWaitForCondition(aConditionFn, retryTimes) {
   let deferred = Promise.defer();
-  waitForCondition(aConditionFn, deferred.resolve, "Condition didn't pass.");
+  waitForCondition(aConditionFn, deferred.resolve, "Condition didn't pass.", retryTimes);
   return deferred.promise;
 }
 
 /**
  * Waits for a window with the given URL to exist.
  *
  * @param url
  *        The url of the window.