Bug 1399242 - Add DAMP test to track performance of background panels. r=nchevobbe
MozReview-Commit-ID: JwZaa3AA0iN
--- a/testing/talos/talos/tests/devtools/addon/content/damp.html
+++ b/testing/talos/talos/tests/devtools/addon/content/damp.html
@@ -28,16 +28,18 @@ var defaultConfig = {
"complicated.netmonitor": true,
"complicated.saveAndReadHeapSnapshot": true,
"console.bulklog": true,
"console.streamlog": true,
"console.objectexpand": true,
"console.openwithcache": true,
"inspector.mutations": true,
+
+ "panelsInBackground.reload": true,
}
};
var testsInfo = {
"cold.inspector": "Measure first open toolbox on inspector panel",
"simple.webconsole": "Measure open/close toolbox on webconsole panel against simple document",
"simple.inspector": "Measure open/close toolbox on inspector panel against simple document",
@@ -55,16 +57,18 @@ var testsInfo = {
"complicated.netmonitor": "Measure open/close toolbox on network monitor panel against complicated document",
"complicated.saveAndReadHeapSnapshot": "Measure open/close toolbox on memory panel and save/read heap snapshot against complicated document",
"console.bulklog": "Measure time for a bunch of sync console.log statements to appear",
"console.streamlog": "Measure rAF on page during a stream of console.log statements",
"console.objectexpand": "Measure time to expand a large object and close the console",
"console.openwithcache": "Measure time to render last logged messages in console for a page with 100 logged messages",
"inspector.mutations": "Measure the time to perform childList mutations when inspector is enabled",
+
+ "panelsInBackground.reload": "Measure page reload time when all panels are in background",
};
function updateConfig() {
config = {subtests: []};
for (var test in defaultConfig.subtests) {
if ($("subtest-" + test).checked) { // eslint-disable-line no-undef
config.subtests.push(test);
}
--- a/testing/talos/talos/tests/devtools/addon/content/damp.js
+++ b/testing/talos/talos/tests/devtools/addon/content/damp.js
@@ -451,16 +451,38 @@ async _consoleOpenWithCachedMessagesTest
async _coldInspectorOpen() {
await this.testSetup(SIMPLE_URL);
await this.openToolboxAndLog("cold.inspector", "inspector");
await this.closeToolbox();
await this.testTeardown();
},
+ async _panelsInBackgroundReload() {
+ let url = "data:text/html;charset=UTF-8," + encodeURIComponent(`
+ <script>
+ // Log a significant amount of messages
+ for(let i = 0; i < 2000; i++) {
+ console.log("log in background", i);
+ }
+ </script>
+ `);
+ await this.testSetup(url);
+ let {toolbox} = await this.openToolbox("webconsole");
+
+ // Select the options panel to make the console be in background.
+ // Options panel should not do anything on page reload.
+ await toolbox.selectTool("options");
+
+ await this.reloadPageAndLog("panelsInBackground");
+
+ await this.closeToolbox();
+ await this.testTeardown();
+ },
+
_getToolLoadingTests(url, label, { expectedMessages, expectedSources }) {
let tests = {
inspector: Task.async(function* () {
yield this.testSetup(url);
let toolbox = yield this.openToolboxAndLog(label + ".inspector", "inspector");
let onReload = async function() {
let inspector = toolbox.getPanel("inspector");
// First wait for markup view to be loaded against the new root node
@@ -733,16 +755,18 @@ async _consoleOpenWithCachedMessagesTest
// Run cold test only once
let topWindow = getMostRecentBrowserWindow();
if (!topWindow.coldRunDAMP) {
topWindow.coldRunDAMP = true;
tests["cold.inspector"] = this._coldInspectorOpen;
}
+ tests["panelsInBackground.reload"] = this._panelsInBackgroundReload;
+
Object.assign(tests, this._getToolLoadingTests(SIMPLE_URL, "simple", {
expectedMessages: 1,
expectedSources: 1,
}));
Object.assign(tests, this._getToolLoadingTests(COMPLICATED_URL, "complicated", {
expectedMessages: 7,
expectedSources: 14,