browser_telemetry_toolboxtabs_options.js (894B)
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_options.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, "options"); 19 checkResults(); 20 21 gBrowser.removeCurrentTab(); 22 }); 23 24 function checkResults() { 25 // For help generating these tests use generateTelemetryTests("DEVTOOLS_OPTIONS_") 26 // here. 27 checkTelemetry("DEVTOOLS_OPTIONS_OPENED_COUNT", "", { 0: 2, 1: 0 }, "array"); 28 checkTelemetry( 29 "DEVTOOLS_OPTIONS_TIME_ACTIVE_SECONDS", 30 "", 31 null, 32 "hasentries" 33 ); 34 }