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 442947 58e229555bce80def91a538521e8b1db7ef0c365
parent 442946 ecaf001fc1da8dce9f97b6c1f8c9187cfeff9af6
child 442948 22497189c81e8bc0b4f4ec7dd3fa6c9372f4c08b
push id36874
push userbmo:ato@mozilla.com
push dateWed, 23 Nov 2016 16:09:45 +0000
reviewersautomatedtester
bugs1319237
milestone53.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
@@ -2454,18 +2454,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.