Bug 1678813 - to ensure we would create promise focus before tab is closed. r=bryce

Differential Revision: https://phabricator.services.mozilla.com/D98014
This commit is contained in:
alwu 2020-11-27 18:09:34 +00:00
parent 50f32274b5
commit 3415872fa2

View file

@ -38,19 +38,17 @@ add_task(async function testNoSrcOrErrorMediaEntersPIPMode() {
tab.linkedBrowser,
testVideoId
);
await ensureMessageAndClosePiP(
tab.linkedBrowser,
testVideoId,
winPIP,
false
);
await Promise.all([
// To ensure the focus would be gave back to the original window. If we do
// not do that, then lacking of focus would interfere other following tests.
SimpleTest.promiseFocus(window),
ensureMessageAndClosePiP(tab.linkedBrowser, testVideoId, winPIP, false),
]);
ok(!controller.isActive, "controller is still inactive");
info(`remove tab`);
await tab.close();
// To ensure the focus would be gave back to the original window. If we do
// not do that, then lacking of focus would interfere other following tests.
await SimpleTest.promiseFocus(window);
}
});