tor-browser

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

browser_webconsole_iframe_wrong_hud.js (1353B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 * http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Ensure that iframes are not associated with the wrong hud. See Bug 593003.
      7 
      8 const TEST_URI =
      9  "https://example.com/browser/devtools/client/webconsole/" +
     10  "test/browser/test-iframe-wrong-hud.html";
     11 
     12 const TEST_IFRAME_URI =
     13  "https://example.com/browser/devtools/client/webconsole/" +
     14  "test/browser/test-iframe-wrong-hud-iframe.html";
     15 
     16 const TEST_DUMMY_URI =
     17  "http://example.com/browser/devtools/client/webconsole/" +
     18  "test/browser/test-console.html";
     19 
     20 add_task(async function () {
     21  await pushPref("devtools.webconsole.filter.net", true);
     22  const tab1 = await addTab(TEST_URI);
     23  const hud1 = await openConsole(tab1);
     24 
     25  const tab2 = await addTab(TEST_DUMMY_URI);
     26  await openConsole(gBrowser.selectedTab);
     27 
     28  info(
     29    "Select the first tab before reloading it in order to ensure renduring the console"
     30  );
     31  gBrowser.selectedTab = tab1;
     32 
     33  info("Reloading tab 1");
     34  await reloadBrowser({ browser: tab1.linkedBrowser });
     35 
     36  info("Waiting for messages");
     37  await waitFor(() => findMessageByType(hud1, TEST_IFRAME_URI, ".network"));
     38 
     39  const hud2 = await openConsole(tab2);
     40  is(
     41    findMessageByType(hud2, TEST_IFRAME_URI, ".network"),
     42    undefined,
     43    "iframe network request is not displayed in tab2"
     44  );
     45 });