2013-05-24 14:26:17 +04:00
|
|
|
/* Any copyright is dedicated to the Public Domain.
|
|
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
|
2016-11-11 12:09:50 +03:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const TEST_URI = "data:text/html;charset=utf-8," +
|
|
|
|
"<p>browser_telemetry_toolboxtabs_jsprofiler.js</p>";
|
2013-05-24 14:26:17 +04:00
|
|
|
|
|
|
|
// Because we need to gather stats for the period of time that a tool has been
|
|
|
|
// opened we make use of setTimeout() to create tool active times.
|
|
|
|
const TOOL_DELAY = 200;
|
|
|
|
|
2018-03-11 13:05:00 +03:00
|
|
|
add_task(async function() {
|
|
|
|
await addTab(TEST_URI);
|
2018-05-01 20:06:14 +03:00
|
|
|
startTelemetry();
|
2013-05-24 14:26:17 +04:00
|
|
|
|
2018-03-11 13:05:00 +03:00
|
|
|
await openAndCloseToolbox(2, TOOL_DELAY, "performance");
|
2018-05-01 20:06:14 +03:00
|
|
|
checkResults();
|
2013-05-24 14:26:17 +04:00
|
|
|
|
|
|
|
gBrowser.removeCurrentTab();
|
2015-01-26 10:35:00 +03:00
|
|
|
});
|
2018-05-01 20:06:14 +03:00
|
|
|
|
|
|
|
function checkResults() {
|
|
|
|
// For help generating these tests use generateTelemetryTests("DEVTOOLS_JSPROFILER")
|
|
|
|
// here.
|
|
|
|
checkTelemetry("DEVTOOLS_JSPROFILER_OPENED_COUNT", "", [2, 0, 0], "array");
|
|
|
|
checkTelemetry("DEVTOOLS_JSPROFILER_TIME_ACTIVE_SECONDS", "", null, "hasentries");
|
|
|
|
}
|