browser_noopener_null_uri.js (613B)
1 add_task(async function browserNoopenerNullUri() { 2 await BrowserTestUtils.withNewTab({ gBrowser }, async function (aBrowser) { 3 let numTabs = gBrowser.tabs.length; 4 await SpecialPowers.spawn(aBrowser, [], async () => { 5 ok( 6 !content.window.open(undefined, undefined, "noopener"), 7 "window.open should return null" 8 ); 9 }); 10 await TestUtils.waitForCondition(() => gBrowser.tabs.length == numTabs + 1); 11 // We successfully opened a tab in content process! 12 }); 13 // We only have to close the tab we opened earlier 14 await BrowserTestUtils.removeTab(gBrowser.tabs[1]); 15 });