зеркало из https://github.com/mozilla/gecko-dev.git
bug 1492499: marionette: bail if visibilitychange does not fire on minimization; r=whimboo
The visibilitychange DOM event does not fire reliably in all configurations when retrieved from web content. It appears to fire more reliably in chrome, but to ensure a call to WebDriver:MinimizeWindow never hangs, we additionally change it to be a TimedPromise. There is an assumption here that if the iconification process does not complete within this duration, there is nothing we can do. Depends on D8413 Differential Revision: https://phabricator.services.mozilla.com/D8414 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
3d84531a75
Коммит
aeb2acfd24
|
@ -3000,15 +3000,15 @@ GeckoDriver.prototype.minimizeWindow = async function() {
|
||||||
const win = assert.open(this.getCurrentWindow());
|
const win = assert.open(this.getCurrentWindow());
|
||||||
await this._handleUserPrompts();
|
await this._handleUserPrompts();
|
||||||
|
|
||||||
if (WindowState.from(win.windowState) == WindowState.Fullscreen) {
|
|
||||||
await exitFullscreen(win);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (WindowState.from(win.windowState) != WindowState.Minimized) {
|
if (WindowState.from(win.windowState) != WindowState.Minimized) {
|
||||||
await new Promise(resolve => {
|
if (WindowState.from(win.windowState) == WindowState.Fullscreen) {
|
||||||
this.curBrowser.eventObserver.addEventListener("visibilitychange", resolve, {once: true});
|
await exitFullscreen(win);
|
||||||
|
}
|
||||||
|
|
||||||
|
await new TimedPromise(resolve => {
|
||||||
|
win.addEventListener("visibilitychange", resolve, {once: true});
|
||||||
win.minimize();
|
win.minimize();
|
||||||
});
|
}, {throws: null});
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.curBrowser.rect;
|
return this.curBrowser.rect;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче