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
This commit is contained in:
Andreas Tolfsen 2018-11-08 13:11:31 +00:00
Родитель de7f55fcf0
Коммит d67daa8b34
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -1449,6 +1449,7 @@ GeckoDriver.prototype.setWindowRect = async function(cmd) {
await exitFullscreen(win);
break;
case WindowState.Maximized:
case WindowState.Minimized:
await restoreWindow(win);
break;