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(function*() { for (let url of testUrls) { let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url); ok(true, "Loaded page " + url); // Wait one turn of the event loop before closing, so everything settles. yield new Promise(resolve => setTimeout(resolve, 0)); yield BrowserTestUtils.removeTab(tab); ok(true, "Closed page " + url + " without timeout"); } });