browser_telemetry_toolboxtabs_webconsole.js (941B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 const TEST_URI = 7 "data:text/html;charset=utf-8," + 8 "<p>browser_telemetry_toolboxtabs_styleeditor_webconsole.js</p>"; 9 10 // Because we need to gather stats for the period of time that a tool has been 11 // opened we make use of setTimeout() to create tool active times. 12 const TOOL_DELAY = 200; 13 14 add_task(async function () { 15 await addTab(TEST_URI); 16 startTelemetry(); 17 18 await openAndCloseToolbox(2, TOOL_DELAY, "webconsole"); 19 checkResults(); 20 21 gBrowser.removeCurrentTab(); 22 }); 23 24 function checkResults() { 25 // For help generating these tests use generateTelemetryTests("DEVTOOLS_WEBCONSOLE_") 26 // here. 27 checkTelemetry( 28 "DEVTOOLS_WEBCONSOLE_OPENED_COUNT", 29 "", 30 { 0: 2, 1: 0 }, 31 "array" 32 ); 33 checkTelemetry( 34 "DEVTOOLS_WEBCONSOLE_TIME_ACTIVE_SECONDS", 35 "", 36 null, 37 "hasentries" 38 ); 39 }