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 479492 7e30c373f5d5023b39f6bb7a24633d9f69770276
parent 479491 c25dda6dbee365e61f687d9e158cbe4c936c5d04
child 479493 0946938ec4800925203b0020fede5388ebc1a05b
push id44268
push userbmo:ato@mozilla.com
push dateMon, 06 Feb 2017 19:54:40 +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
@@ -2420,18 +2420,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.