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