summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/flexbox/test/browser_flexbox_highlighter_opened_telemetry.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--devtools/client/inspector/flexbox/test/browser_flexbox_highlighter_opened_telemetry.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/devtools/client/inspector/flexbox/test/browser_flexbox_highlighter_opened_telemetry.js b/devtools/client/inspector/flexbox/test/browser_flexbox_highlighter_opened_telemetry.js
new file mode 100644
index 0000000000..62c63e8b9f
--- /dev/null
+++ b/devtools/client/inspector/flexbox/test/browser_flexbox_highlighter_opened_telemetry.js
@@ -0,0 +1,37 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Test that the telemetry is correct when the flexbox highlighter is activated from
+// the layout view.
+
+const TEST_URI = URL_ROOT + "doc_flexbox_specific_cases.html";
+
+add_task(async function () {
+ await addTab(TEST_URI);
+ startTelemetry();
+ const { inspector, flexboxInspector } = await openLayoutView();
+ const { document: doc } = flexboxInspector;
+ const onFlexHighlighterToggleRendered = waitForDOM(
+ doc,
+ "#flexbox-checkbox-toggle"
+ );
+ await selectNode("#container", inspector);
+ const [flexHighlighterToggle] = await onFlexHighlighterToggleRendered;
+
+ await toggleHighlighterON(flexHighlighterToggle, inspector);
+ await toggleHighlighterOFF(flexHighlighterToggle, inspector);
+
+ checkResults();
+});
+
+function checkResults() {
+ checkTelemetry("devtools.layout.flexboxhighlighter.opened", "", 1, "scalar");
+ checkTelemetry(
+ "DEVTOOLS_FLEXBOX_HIGHLIGHTER_TIME_ACTIVE_SECONDS",
+ "",
+ null,
+ "hasentries"
+ );
+}