tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_telemetry_toolboxtabs_jsdebugger.js (929B)


      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_jsdebugger.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, "jsdebugger");
     19  checkResults();
     20 
     21  gBrowser.removeCurrentTab();
     22 });
     23 
     24 function checkResults() {
     25  // For help generating these tests use generateTelemetryTests("DEVTOOLS_JSDEBUGGER_")
     26  // here.
     27  checkTelemetry(
     28    "DEVTOOLS_JSDEBUGGER_OPENED_COUNT",
     29    "",
     30    { 0: 2, 1: 0 },
     31    "array"
     32  );
     33  checkTelemetry(
     34    "DEVTOOLS_JSDEBUGGER_TIME_ACTIVE_SECONDS",
     35    "",
     36    null,
     37    "hasentries"
     38  );
     39 }