tor-browser

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

browser_styleeditor_import_rule.js (814B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 "use strict";
      4 
      5 // Test that style editor shows sheets loaded with @import rules.
      6 
      7 // http rather than chrome to improve coverage
      8 const TESTCASE_URI = TEST_BASE_HTTPS + "import.html";
      9 
     10 add_task(async function () {
     11  const { ui } = await openStyleEditorForURL(TESTCASE_URI);
     12 
     13  is(ui.editors.length, 3, "there are 3 stylesheets after loading @imports");
     14 
     15  is(
     16    ui.editors[0].styleSheet.href,
     17    TEST_BASE_HTTPS + "simple.css",
     18    "stylesheet 1 is simple.css"
     19  );
     20 
     21  is(
     22    ui.editors[1].styleSheet.href,
     23    TEST_BASE_HTTPS + "import.css",
     24    "stylesheet 2 is import.css"
     25  );
     26 
     27  is(
     28    ui.editors[2].styleSheet.href,
     29    TEST_BASE_HTTPS + "import2.css",
     30    "stylesheet 3 is import2.css"
     31  );
     32 });