Bug 1381876 - Return window rect from Context#rect consistently. r=automatedtester
authorAndreas Tolfsen <ato@sny.no>
Tue, 01 Aug 2017 18:17:29 +0100
changeset 422570 92a8be47bbd7e0537f8c29a80672505a91d64840
parent 422569 86cb93e08b08d182c31e194331148db4d1da26a9
child 422571 03c1eabbcbc642cbc3bbbc1052b40aa47d2b06b8
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester
bugs1381876
milestone57.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 1381876 - Return window rect from Context#rect consistently. r=automatedtester MozReview-Commit-ID: D5pCPK2PEr3
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2906,36 +2906,27 @@ GeckoDriver.prototype.setScreenOrientati
  * @throws {UnexpectedAlertOpenError}
  *     A modal dialog is open, blocking this operation.
  */
 GeckoDriver.prototype.minimizeWindow = function* (cmd, resp) {
   assert.firefox();
   const win = assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
-  let state;
   yield new Promise(resolve => {
     win.addEventListener("sizemodechange", resolve, {once: true});
 
     if (win.windowState == win.STATE_MINIMIZED) {
       win.restore();
-      state = "normal";
     } else {
       win.minimize();
-      state = "minimized";
     }
   });
 
-  resp.body = {
-    x: win.screenX,
-    y: win.screenY,
-    width: win.outerWidth,
-    height: win.outerHeight,
-    state,
-  };
+  return this.curBrowser.rect;
 };
 
 /**
  * Synchronously maximizes the user agent window as if the user pressed
  * the maximize button, or restores it if it is already maximized.
  *
  * Not supported on Fennec.
  *
@@ -2959,22 +2950,17 @@ GeckoDriver.prototype.maximizeWindow = f
 
     if (win.windowState == win.STATE_MAXIMIZED) {
       win.restore();
     } else {
       win.maximize();
     }
   });
 
-  resp.body = {
-    x: win.screenX,
-    y: win.screenY,
-    width: win.outerWidth,
-    height: win.outerHeight,
-  };
+  return this.curBrowser.rect;
 };
 
 /**
  * Synchronously sets the user agent window to full screen as if the user
  * had done "View > Enter Full Screen", or restores it if it is already
  * in full screen.
  *
  * Not supported on Fennec.
@@ -2991,26 +2977,20 @@ GeckoDriver.prototype.maximizeWindow = f
  */
 GeckoDriver.prototype.fullscreen = function* (cmd, resp) {
   assert.firefox();
   const win = assert.window(this.getCurrentWindow());
   assert.noUserPrompt(this.dialog);
 
   yield new Promise(resolve => {
     win.addEventListener("sizemodechange", resolve, {once: true});
-
     win.fullScreen = !win.fullScreen;
   });
 
-  resp.body = {
-    x: win.screenX,
-    y: win.screenY,
-    width: win.outerWidth,
-    height: win.outerHeight,
-  };
+  return this.curBrowser.rect;
 };
 
 /**
  * Dismisses a currently displayed tab modal, or returns no such alert if
  * no modal is displayed.
  */
 GeckoDriver.prototype.dismissDialog = function(cmd, resp) {
   assert.window(this.getCurrentWindow());