зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1478358 - [marionette] Don't wait for resize events in "Set Window Rect". r=ato
Differential Revision: https://phabricator.services.mozilla.com/D16338 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
461f107cb9
Коммит
b67d0c309e
|
@ -1455,27 +1455,14 @@ GeckoDriver.prototype.setWindowRect = async function(cmd) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (height != null && width != null) {
|
||||
if (width != null && height != null) {
|
||||
assert.positiveInteger(height);
|
||||
assert.positiveInteger(width);
|
||||
|
||||
let debounce = new DebounceCallback(() => {
|
||||
win.dispatchEvent(new win.CustomEvent("resizeEnd"));
|
||||
});
|
||||
|
||||
await new TimedPromise(async resolve => {
|
||||
if (win.outerWidth == width && win.outerHeight == height) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
win.addEventListener("resize", debounce);
|
||||
win.addEventListener("resizeEnd", resolve, {once: true});
|
||||
if (win.outerWidth != width || win.outerHeight != height) {
|
||||
win.resizeTo(width, height);
|
||||
await new IdlePromise(win);
|
||||
}, {timeout: 5000});
|
||||
|
||||
win.removeEventListener("resize", debounce);
|
||||
}
|
||||
}
|
||||
|
||||
if (x != null && y != null) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче