tor-browser

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

browser_net_internal-stylesheet.js (894B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 const TEST_URL = EXAMPLE_URL + "html_internal-stylesheet.html";
      7 
      8 /**
      9 * Test for the stylesheet which is loaded as internal.
     10 */
     11 add_task(async function () {
     12  const { monitor } = await initNetMonitor(TEST_URL, {
     13    requestCount: 2,
     14  });
     15 
     16  const wait = waitForNetworkEvents(monitor, 2);
     17  await reloadBrowser();
     18  await wait;
     19 
     20  const { store } = monitor.panelWin;
     21  const requests = store.getState().requests.requests;
     22  is(
     23    requests.length,
     24    2,
     25    "The number of requests state in the store is correct"
     26  );
     27 
     28  const styleSheetRequest = requests.find(
     29    r => r.urlDetails.baseNameWithQuery === "internal-loaded.css"
     30  );
     31  ok(
     32    styleSheetRequest,
     33    "The stylesheet which is loaded as internal is in the request"
     34  );
     35 
     36  return teardown(monitor);
     37 });