bug 1492499: marionette: restore from maximized before setting rect; r=whimboo
authorAndreas Tolfsen <ato@sny.no>
Thu, 08 Nov 2018 13:11:31 +0000
changeset 504350 81ac8f7d11b1d003d1a64ad94bfef4cb49553f91
parent 504349 05b349eaba5481fc81f443be601e612303abe85b
child 504351 a4fcddffde4140fc2c0597055ae216eed4c795fd
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1492499
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1492499: marionette: restore from maximized before setting rect; r=whimboo On certain window manager configurations a window may be resized to fit the full available dimensions of the screen without going into the maximised state. Similarily, a maximised window may be the exact dimensions of the screen. If the window outerWidth/outerHeight is 800x600 and in maximised state, resizing it to 800x600 through WebDriver:SetWindowRect will not work because the window has already reached its requested dimensions. This patch ensures to wait for the resizeEnd event when the window state is not normal. Depends on D8419 Differential Revision: https://phabricator.services.mozilla.com/D10568
testing/marionette/driver.js
--- a/testing/marionette/driver.js
+++ b/testing/marionette/driver.js
@@ -1444,16 +1444,17 @@ GeckoDriver.prototype.setWindowRect = as
 
   let {x, y, width, height} = cmd.parameters;
 
   switch (WindowState.from(win.windowState)) {
     case WindowState.Fullscreen:
       await exitFullscreen(win);
       break;
 
+    case WindowState.Maximized:
     case WindowState.Minimized:
       await restoreWindow(win);
       break;
   }
 
   if (height != null && width != null) {
     assert.positiveInteger(height);
     assert.positiveInteger(width);