Bug 1319237 - Assign GeckoDriver#getWindowSize return value in one statement; r=automatedtester draft
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 21 Nov 2016 23:36:29 +0100
changeset 482811 ed166d858412698e320555c5485d2bfb9b4173b1
parent 482810 bf61c18b9a3ab7865cdc3aa063875313823ff295
child 482812 5fed98284ab6f32009cdb1fa819cf2337adb4a73
push id45172
push userbmo:ato@mozilla.com
push dateMon, 13 Feb 2017 14:08:30 +0000
reviewersautomatedtester
bugs1319237
milestone54.0a1
Bug 1319237 - Assign GeckoDriver#getWindowSize return value in one statement; r=automatedtester MozReview-Commit-ID: BGH1WkgH91p
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -2400,18 +2400,20 @@ GeckoDriver.prototype.setScreenOrientati
  * Get the size of the browser window currently in focus.
  *
  * Will return the current browser window size in pixels. Refers to
  * window outerWidth and outerHeight values, which include scroll bars,
  * title bars, etc.
  */
 GeckoDriver.prototype.getWindowSize = function (cmd, resp) {
   let win = this.getCurrentWindow();
-  resp.body.width = win.outerWidth;
-  resp.body.height = win.outerHeight;
+  return {
+    width: win.outerWidth,
+    height: win.outerHeight,
+  };
 };
 
 /**
  * Set the size of the browser window currently in focus.
  *
  * Not supported on B2G. The supplied width and height values refer to
  * the window outerWidth and outerHeight values, which include scroll
  * bars, title bars, etc.