From d67daa8b347a350fbccfec766e7908f16d006bb1 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Thu, 8 Nov 2018 13:11:31 +0000 Subject: [PATCH] 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 --HG-- extra : moz-landing-system : lando --- testing/marionette/driver.js | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/marionette/driver.js b/testing/marionette/driver.js index 18d5bc0df16a..58a75ee76867 100644 --- a/testing/marionette/driver.js +++ b/testing/marionette/driver.js @@ -1449,6 +1449,7 @@ GeckoDriver.prototype.setWindowRect = async function(cmd) { await exitFullscreen(win); break; + case WindowState.Maximized: case WindowState.Minimized: await restoreWindow(win); break;