browser_flexbox_highlighter_opened_telemetry.js (1070B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Test that the telemetry is correct when the flexbox highlighter is activated from 7 // the layout view. 8 9 const TEST_URI = URL_ROOT + "doc_flexbox_specific_cases.html"; 10 11 add_task(async function () { 12 await addTab(TEST_URI); 13 startTelemetry(); 14 const { inspector, flexboxInspector } = await openLayoutView(); 15 const { document: doc } = flexboxInspector; 16 const onFlexHighlighterToggleRendered = waitForDOM( 17 doc, 18 "#flexbox-checkbox-toggle" 19 ); 20 await selectNode("#container", inspector); 21 const [flexHighlighterToggle] = await onFlexHighlighterToggleRendered; 22 23 await toggleHighlighterON(flexHighlighterToggle, inspector); 24 await toggleHighlighterOFF(flexHighlighterToggle, inspector); 25 26 checkResults(); 27 }); 28 29 function checkResults() { 30 checkTelemetry("devtools.layout.flexboxhighlighter.opened", "", 1, "scalar"); 31 checkTelemetry( 32 "DEVTOOLS_FLEXBOX_HIGHLIGHTER_TIME_ACTIVE_SECONDS", 33 "", 34 null, 35 "hasentries" 36 ); 37 }