summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/fonts/test/browser_fontinspector_no-fonts.js
blob: 454cabdf9285147af6095fa0afa6b6266c9c9a38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";

// Check that the warning message for no fonts found shows up when selecting a node
// that does not have any used fonts.
// Ensure that no used fonts are listed.

const TEST_URI = URL_ROOT + "doc_browser_fontinspector.html";

add_task(async function () {
  const { view, inspector } = await openFontInspectorForURL(TEST_URI);
  const viewDoc = view.document;
  await selectNode(".empty", inspector);

  info("Test the warning message for no fonts found on empty element");
  const warning = viewDoc.querySelector(
    "#font-editor .devtools-sidepanel-no-result"
  );
  ok(warning, "The warning for no fonts found is shown for the empty element");

  info("Test that no fonts are listed for the empty element");
  const fontsEls = getUsedFontsEls(viewDoc);
  is(fontsEls.length, 0, "There are no used fonts listed");
});