tor-browser

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

browser_aboutdebugging_tab_navigate.js (1064B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 const TAB_1_URL =
      7  "http://example.org/document-builder.sjs?html=<title>TITLE1</title>";
      8 const TAB_2_URL =
      9  "http://example.org/document-builder.sjs?html=<title>TITLE2</title>";
     10 
     11 // Check that the list of tabs in about:debugging is updated when a page
     12 // navigates. This indirectly checks that the tabListChanged event is correctly
     13 // fired from the root actor.
     14 add_task(async function () {
     15  const { document, tab, window } = await openAboutDebugging();
     16  await selectThisFirefoxPage(document, window.AboutDebugging.store);
     17 
     18  const testTab = await addTab(TAB_1_URL, { background: true });
     19  await waitFor(() => findDebugTargetByText("TITLE1", document));
     20 
     21  navigateTo(TAB_2_URL, { browser: testTab.linkedBrowser });
     22  await waitFor(() => findDebugTargetByText("TITLE2", document));
     23 
     24  ok(
     25    !findDebugTargetByText("TITLE1", document),
     26    "TITLE2 target replaced TITLE1"
     27  );
     28 
     29  await removeTab(tab);
     30  await removeTab(testTab);
     31 });