Bug 1319237 - Assign GeckoDriver#getWindowSize return value in one statement. r=automatedtester, a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Mon, 21 Nov 2016 23:36:29 +0100
changeset 378500 20b7c1a2b0ce4951b0645d1151f98f7ee73ef983
parent 378499 0065cd32253c0bc80b696925bc57f48ba35e5b1a
child 378501 5384084ee6d3b204f9ce090f802f73b9b405e5a0
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersautomatedtester, test-only
bugs1319237
milestone53.0a2
Bug 1319237 - Assign GeckoDriver#getWindowSize return value in one statement. r=automatedtester, a=test-only 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.