tor-browser

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

browser_net_stacktraces-no-chrome-frames.js (1238B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 https://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 /**
      7 * Tests that chrome URIs are not added to the stacktrace details
      8 * panel in the netmonitor.
      9 */
     10 
     11 add_task(async function () {
     12  const URL = EXAMPLE_URL + "html_single_get_page_favicon.html";
     13 
     14  const { monitor } = await initNetMonitor(URL, {
     15    requestCount: 1,
     16  });
     17 
     18  const { document, store, windowRequire } = monitor.panelWin;
     19  const Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
     20 
     21  store.dispatch(Actions.batchEnable(false));
     22 
     23  info("Starting test...");
     24 
     25  await reloadBrowser();
     26 
     27  await waitUntil(() =>
     28    document.querySelector(".requests-list-file[title*='favicon.ico']")
     29  );
     30 
     31  const row = document.querySelector(
     32    ".requests-list-file[title*='favicon.ico']"
     33  );
     34 
     35  ok(row, "Favicon request row should appear in the Netmonitor");
     36 
     37  EventUtils.sendMouseEvent({ type: "mousedown" }, row);
     38 
     39  await waitUntil(() => document.querySelector(".network-details-bar"));
     40 
     41  await waitForTime(1000);
     42 
     43  const stackTab = document.querySelector("#stack-trace-tab");
     44 
     45  is(stackTab, null, "Favicon request should not show a stack trace tab");
     46 
     47  return teardown(monitor);
     48 });