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 479399 2d0d0f24a64757bc4e8b5d42b9028c7c0b9142ac
parent 479398 30c79f48453e1d5b07fb852288ab711688c2ebb4
child 479400 d4959ce127df8f88f78dafcfbba1195444f9a3ee
push id44243
push userbmo:ato@mozilla.com
push dateMon, 06 Feb 2017 16:11:43 +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.