var testUrls = [ "data:text/html,
Testing alert during pagehide/beforeunload/unload", "data:text/html,Testing prompt during pagehide/beforeunload/unload", "data:text/html,Testing confirm during pagehide/beforeunload/unload", ]; add_task(async function () { for (let url of testUrls) { let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url); ok(true, "Loaded page " + url); // Wait one turn of the event loop before closing, so everything settles. await new Promise(resolve => setTimeout(resolve, 0)); BrowserTestUtils.removeTab(tab); ok(true, "Closed page " + url + " without timeout"); } });