Bug 1500072 - Add metrics test for netmonitor;r=ochameau

Depends on D19638

Differential Revision: https://phabricator.services.mozilla.com/D19639

--HG--
rename : devtools/client/framework/test/metrics/browser_metrics_webconsole.ini => devtools/client/framework/test/metrics/browser_metrics_netmonitor.ini
rename : devtools/client/framework/test/metrics/browser_metrics_webconsole.js => devtools/client/framework/test/metrics/browser_metrics_netmonitor.js
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2019-02-13 10:04:34 +00:00
Родитель f425d90e9d
Коммит 3ff22c554e
3 изменённых файлов: 44 добавлений и 0 удалений

Просмотреть файл

@ -7,6 +7,7 @@
BROWSER_CHROME_MANIFESTS += [
'test/browser.ini',
'test/metrics/browser_metrics_inspector.ini',
'test/metrics/browser_metrics_netmonitor.ini',
'test/metrics/browser_metrics_webconsole.ini',
]
XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']

Просмотреть файл

@ -0,0 +1,12 @@
[DEFAULT]
tags = devtools
subsuite = devtools
support-files =
head.js
!/devtools/client/shared/test/shared-head.js
!/devtools/client/shared/test/telemetry-test-helpers.js
# Each metrics tests is loaded in a separate .ini file. This way the test is executed
# individually, without any other test being executed before or after.
[browser_metrics_netmonitor.js]
skip-if = os != 'linux' || debug || asan # Results should be platform agnostic - only run on linux64-opt

Просмотреть файл

@ -0,0 +1,31 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* import-globals-from ../../../shared/test/shared-head.js */
/**
* This test records the number of modules loaded by DevTools, as well as the total count
* of characters in those modules, when opening the netmonitor. These metrics are
* retrieved by perfherder via logs.
*/
const TEST_URL = "data:text/html;charset=UTF-8,<div>Netmonitor modules load test</div>";
add_task(async function() {
const toolbox = await openNewTabAndToolbox(TEST_URL, "netmonitor");
const panel = toolbox.getCurrentPanel();
// Retrieve the browser loader dedicated to the Netmonitor.
const netmonitorLoader = panel.panelWin.getBrowserLoaderForWindow();
const loaders = [loader.provider.loader, netmonitorLoader.loader];
runMetricsTest({
filterString: "devtools/client/netmonitor",
loaders,
panelName: "netmonitor",
});
});