summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/fonts/test/browser_fontinspector_editor-values.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--devtools/client/inspector/fonts/test/browser_fontinspector_editor-values.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/devtools/client/inspector/fonts/test/browser_fontinspector_editor-values.js b/devtools/client/inspector/fonts/test/browser_fontinspector_editor-values.js
new file mode 100644
index 0000000000..dd9879eff4
--- /dev/null
+++ b/devtools/client/inspector/fonts/test/browser_fontinspector_editor-values.js
@@ -0,0 +1,36 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+const TEST_URI = URL_ROOT + "doc_browser_fontinspector.html";
+
+add_task(async function () {
+ const { inspector, view } = await openFontInspectorForURL(TEST_URI);
+ const viewDoc = view.document;
+
+ await testDiv(inspector, viewDoc);
+ await testNestedSpan(inspector, viewDoc);
+});
+
+async function testDiv(inspector, viewDoc) {
+ await selectNode("DIV", inspector);
+ const { value, unit } = getPropertyValue(viewDoc, "font-size");
+
+ is(value + unit, "1em", "DIV should be have font-size of 1em");
+}
+
+async function testNestedSpan(inspector, viewDoc) {
+ await selectNode(".nested-span", inspector);
+ const { value, unit } = getPropertyValue(viewDoc, "font-size");
+
+ isnot(
+ value + unit,
+ "1em",
+ "Nested span should not reflect parent's font size."
+ );
+ is(
+ value + unit,
+ "36px",
+ "Nested span should have computed font-size of 36px"
+ );
+}