tor-browser

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

browser_net_column_path.js (1381B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 /**
      7 * Tests for path column. Note that the column
      8 * header is visible only if there are requests in the list.
      9 */
     10 add_task(async function () {
     11  const { monitor, tab } = await initNetMonitor(SIMPLE_URL, {
     12    requestCount: 1,
     13  });
     14  const { document } = monitor.panelWin;
     15  info("Starting test... ");
     16 
     17  const onNetworkEvents = waitForNetworkEvents(monitor, 2);
     18  await reloadBrowser();
     19  await ContentTask.spawn(tab.linkedBrowser, null, () => {
     20    content.wrappedJSObject.fetch("data:text/plain,some_text");
     21  });
     22  await onNetworkEvents;
     23 
     24  await showColumn(monitor, "path");
     25 
     26  const pathColumn = document.querySelector(`.requests-list-path`);
     27  const requestList = document.querySelectorAll(
     28    ".network-monitor .request-list-item"
     29  );
     30 
     31  ok(pathColumn, "Path column should be visible");
     32  is(
     33    requestList[0].querySelector(".requests-list-path div:first-child")
     34      .textContent,
     35    "/browser/devtools/client/netmonitor/test/html_simple-test-page.html",
     36    "Path content should contain the request url without origin"
     37  );
     38  is(
     39    requestList[1].querySelector(".requests-list-path div:first-child")
     40      .textContent,
     41    "data:text/plain,some_text",
     42    "Path content should contain the data url"
     43  );
     44 
     45  await teardown(monitor);
     46 });