Backed out 2 changesets (bug 1529516) per dev's request for causing issues with wdspec a=backout
authorNoemi Erli <nerli@mozilla.com>
Sat, 23 Feb 2019 12:54:36 +0200
changeset 518607 9f20371d98ecbafed01fd8a3836d570e7f1e09b7
parent 518606 6924dd16f7b1e2e6ce71a8eb4cbe330d3e4745dc
child 518619 98e5989a28405532380ead065a65cd829730dd6d
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1529516
milestone67.0a1
backs out0c48c658c7cfcc8b49e69b4805d8eb64b3f1cb48
4e00119c579cf49617d95f147cfbb9434b9a4039
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
Backed out 2 changesets (bug 1529516) per dev's request for causing issues with wdspec a=backout Backed out changeset 0c48c658c7cf (bug 1529516) Backed out changeset 4e00119c579c (bug 1529516)
testing/marionette/sync.js
--- a/testing/marionette/sync.js
+++ b/testing/marionette/sync.js
@@ -208,31 +208,28 @@ function TimedPromise(fn,
   if (typeof timeout != "number") {
     throw new TypeError();
   }
   if (!Number.isInteger(timeout) || timeout < 0) {
     throw new RangeError();
   }
 
   return new Promise((resolve, reject) => {
-    let trace;
-
     // Reject only if |throws| is given.  Otherwise it is assumed that
     // the user is OK with the promise timing out.
     let bail = () => {
       if (throws !== null) {
         let err = new throws();
         reject(err);
       } else {
-        log.warn(`TimedPromise timed out after ${timeout} ms`, trace);
+        log.warn(`TimedPromise timed out after ${timeout} ms`, stack());
         resolve();
       }
     };
 
-    trace = stack();
     timer.initWithCallback({notify: bail}, timeout, TYPE_ONE_SHOT);
 
     try {
       fn(resolve, reject);
     } catch (e) {
       reject(e);
     }
   }).then(res => {
@@ -257,24 +254,17 @@ function TimedPromise(fn,
  *     If `timeout` is not a number.
  * @throws {RangeError}
  *     If `timeout` is not an unsigned integer.
  */
 function Sleep(timeout) {
   if (typeof timeout != "number") {
     throw new TypeError();
   }
-  if (!Number.isInteger(timeout) || timeout < 0) {
-    throw new RangeError();
-  }
-
-  return new Promise(resolve => {
-    const timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-    timer.initWithCallback({notify: resolve}, timeout, TYPE_ONE_SHOT);
-  });
+  return new TimedPromise(() => {}, {timeout, throws: null});
 }
 
 /**
  * Detects when the specified message manager has been destroyed.
  *
  * One can observe the removal and detachment of a content browser
  * (`<xul:browser>`) or a chrome window by its message manager
  * disconnecting.