tor-browser

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

browser_fontinspector_input-element-used-font.js (816B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 "use strict";
      4 
      5 const TEST_URI = URL_ROOT + "doc_browser_fontinspector.html";
      6 
      7 // Verify that a styled input field element is showing proper font information
      8 // in its font tab.
      9 // Non-regression test for https://bugzilla.mozilla.org/show_bug.cgi?id=1435469
     10 add_task(async function () {
     11  const { inspector, view } = await openFontInspectorForURL(TEST_URI);
     12  const viewDoc = view.document;
     13 
     14  await selectNode(".input-field", inspector);
     15 
     16  const fontEls = getUsedFontsEls(viewDoc);
     17  Assert.equal(fontEls.length, 1, `Used fonts found for styled input element`);
     18  Assert.equal(
     19    fontEls[0].textContent,
     20    "Ostrich Sans Medium",
     21    `Proper font found: 'Ostrich Sans Medium' for styled input.`
     22  );
     23 });