mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bug 1678813 - part2 : await all promises to ensure window is focus and loaded. r=mconley
On try server, sometime I noticed that we would get intermittent failure on waiting the window focus. From its description [1], that method won't resolve the promise for already focus window. So we should call that method earlier in order to prevent the intermittent failure where the method is called on a focused window. [1] https://searchfox.org/mozilla-central/rev/168c45a7acc44e9904cfd4eebcb9eb080e05699c/testing/mochitest/tests/SimpleTest/SimpleTest.js#933-938 Differential Revision: https://phabricator.services.mozilla.com/D98283
This commit is contained in:
parent
7abb275b8f
commit
cc933e516a
@ -103,9 +103,11 @@ async function triggerPictureInPicture(browser, videoID) {
|
||||
}, "Video is being cloned visually.");
|
||||
});
|
||||
let win = await domWindowOpened;
|
||||
await win.promiseDocumentFlushed(() => {});
|
||||
await videoReady;
|
||||
await SimpleTest.promiseFocus(win);
|
||||
await Promise.all([
|
||||
SimpleTest.promiseFocus(win),
|
||||
win.promiseDocumentFlushed(() => {}),
|
||||
videoReady,
|
||||
]);
|
||||
return win;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user