mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 05:15:45 +00:00
Bug 1500818 - wait for focus and activate of new windows in BTU.waitForNewWindow, r=dao
Differential Revision: https://phabricator.services.mozilla.com/D9364 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
a8cf5d4304
commit
73fbe18957
@ -7,6 +7,7 @@ const TEST_LINK = "https://example.com/";
|
||||
const RESOURCE_LINK = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com") + "test_contextmenu_links.html";
|
||||
|
||||
async function activateContextAndWaitFor(selector, where) {
|
||||
info("Starting test for " + where);
|
||||
let contextMenuItem = "openlink";
|
||||
let openPromise;
|
||||
let closeMethod;
|
||||
@ -54,7 +55,9 @@ async function activateContextAndWaitFor(selector, where) {
|
||||
contextMenu.hidePopup();
|
||||
await awaitPopupHidden;
|
||||
|
||||
info("Waiting for the link to open");
|
||||
let openedThing = await openPromise;
|
||||
info("Waiting for the opened window/tab to close");
|
||||
await closeMethod(openedThing);
|
||||
}
|
||||
|
||||
|
@ -589,6 +589,8 @@ var BrowserTestUtils = {
|
||||
let promises = [
|
||||
TestUtils.topicObserved("browser-delayed-startup-finished",
|
||||
subject => subject == win),
|
||||
this.waitForEvent(win, "focus"),
|
||||
this.waitForEvent(win, "activate"),
|
||||
];
|
||||
|
||||
if (url) {
|
||||
|
Loading…
Reference in New Issue
Block a user