browser_metrics_inspector.js (1354B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 /** 7 * This test records the number of modules loaded by DevTools, as well as the total count 8 * of characters in those modules, when opening the inspector. These metrics are retrieved 9 * by perfherder via logs. 10 */ 11 12 const TEST_URL = 13 "data:text/html;charset=UTF-8,<div>Inspector modules load test</div>"; 14 15 add_task(async function () { 16 const toolbox = await openNewTabAndToolbox(TEST_URL, "inspector"); 17 const toolboxBrowserLoader = toolbox.win.getBrowserLoaderForWindow(); 18 19 // Most panels involve three loaders: 20 // - the global devtools loader 21 // - the browser loader used by the toolbox 22 // - a specific browser loader created for the panel 23 // But the inspector is a specific case, because it reuses the BrowserLoader 24 // of the toolbox to load its react components. This is why we only list 25 // two loaders here. 26 const loaders = [loader.loader, toolboxBrowserLoader.loader]; 27 28 runDuplicatedModulesTest(loaders, [ 29 "@loader/unload.js", 30 "@loader/options.js", 31 "resource://devtools/client/shared/vendor/redux.js", 32 "resource://devtools/client/shared/vendor/fluent-react.js", 33 ]); 34 35 runMetricsTest({ 36 filterString: "devtools/client/inspector", 37 loaders, 38 panelName: "inspector", 39 }); 40 });