tor-browser

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

browser_telemetry_toolboxtabs_storage.js (895B)


      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_storage.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 = 1000;
     13 
     14 add_task(async function () {
     15  await addTab(TEST_URI);
     16  startTelemetry();
     17 
     18  await openAndCloseToolbox(2, TOOL_DELAY, "storage");
     19  checkResults();
     20 
     21  gBrowser.removeCurrentTab();
     22 });
     23 
     24 function checkResults() {
     25  // For help generating these tests use generateTelemetryTests("DEVTOOLS_STORAGE_")
     26  // here.
     27  checkTelemetry("DEVTOOLS_STORAGE_OPENED_COUNT", "", { 0: 2, 1: 0 }, "array");
     28  checkTelemetry(
     29    "DEVTOOLS_STORAGE_TIME_ACTIVE_SECONDS",
     30    "",
     31    null,
     32    "hasentries"
     33  );
     34 }