Bug 1478358 - [marionette] Don't wait for resize events in "Set Window Rect". r=ato
authorHenrik Skupin <mail@hskupin.info>
Mon, 14 Jan 2019 15:24:54 +0000
changeset 513723 602e8cefc90030f5ae190c56ae155cb5d03f9402
parent 513722 701665c38279f670742aebe1aee58291484ce129
child 513724 d4a75d417b037b3e3a0b52c86ebba9b1f3fdb99a
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1478358
milestone66.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 1478358 - [marionette] Don't wait for resize events in "Set Window Rect". r=ato Differential Revision: https://phabricator.services.mozilla.com/D16338
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -1450,37 +1450,24 @@ GeckoDriver.prototype.setWindowRect = as
       break;
 
     case WindowState.Maximized:
     case WindowState.Minimized:
       await restoreWindow(win);
       break;
   }
 
-  if (height != null && width != null) {
+  if (width != null && height != null) {
     assert.positiveInteger(height);
     assert.positiveInteger(width);
 
-    let debounce = new DebounceCallback(() => {
-      win.dispatchEvent(new win.CustomEvent("resizeEnd"));
-    });
-
-    await new TimedPromise(async resolve => {
-      if (win.outerWidth == width && win.outerHeight == height) {
-        resolve();
-        return;
-      }
-
-      win.addEventListener("resize", debounce);
-      win.addEventListener("resizeEnd", resolve, {once: true});
+    if (win.outerWidth != width || win.outerHeight != height) {
       win.resizeTo(width, height);
       await new IdlePromise(win);
-    }, {timeout: 5000});
-
-    win.removeEventListener("resize", debounce);
+    }
   }
 
   if (x != null && y != null) {
     assert.integer(x);
     assert.integer(y);
 
     if (win.screenX != x || win.screenY != y) {
       win.moveTo(x, y);