tor-browser

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

browser_fontinspector_no-fonts.js (945B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 "use strict";
      4 
      5 // Check that the warning message for no fonts found shows up when selecting a node
      6 // that does not have any used fonts.
      7 // Ensure that no used fonts are listed.
      8 
      9 const TEST_URI = URL_ROOT + "doc_browser_fontinspector.html";
     10 
     11 add_task(async function () {
     12  const { view, inspector } = await openFontInspectorForURL(TEST_URI);
     13  const viewDoc = view.document;
     14  await selectNode(".empty", inspector);
     15 
     16  info("Test the warning message for no fonts found on empty element");
     17  const warning = viewDoc.querySelector(
     18    "#font-editor .devtools-sidepanel-no-result"
     19  );
     20  ok(warning, "The warning for no fonts found is shown for the empty element");
     21 
     22  info("Test that no fonts are listed for the empty element");
     23  const fontsEls = getUsedFontsEls(viewDoc);
     24  is(fontsEls.length, 0, "There are no used fonts listed");
     25 });