tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_navigate_replace_browsingcontext.js (849B)


      1 add_task(async function parent_to_remote() {
      2  await BrowserTestUtils.withNewTab("about:mozilla", async browser => {
      3    let originalBC = browser.browsingContext;
      4 
      5    BrowserTestUtils.startLoadingURIString(browser, "https://example.com/");
      6    await BrowserTestUtils.browserLoaded(browser);
      7    let newBC = browser.browsingContext;
      8 
      9    isnot(originalBC.id, newBC.id, "Should have replaced the BrowsingContext");
     10  });
     11 });
     12 
     13 add_task(async function remote_to_parent() {
     14  await BrowserTestUtils.withNewTab("https://example.com/", async browser => {
     15    let originalBC = browser.browsingContext;
     16 
     17    BrowserTestUtils.startLoadingURIString(browser, "about:mozilla");
     18    await BrowserTestUtils.browserLoaded(browser);
     19    let newBC = browser.browsingContext;
     20 
     21    isnot(originalBC.id, newBC.id, "Should have replaced the BrowsingContext");
     22  });
     23 });