Bug 1399242 - Add DAMP test to track performance of background panels. r=nchevobbe

MozReview-Commit-ID: JwZaa3AA0iN

--HG--
extra : rebase_source : 91a2fc3003bc191a4408c5671f49094a7b2ec504
This commit is contained in:
Alexandre Poirot 2017-10-24 02:38:21 -07:00
Родитель e8f24cc6ab
Коммит e89a6b8d04
2 изменённых файлов: 28 добавлений и 0 удалений

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

@ -33,6 +33,8 @@ var defaultConfig = {
"console.objectexpand": true,
"console.openwithcache": true,
"inspector.mutations": true,
"panelsInBackground.reload": true,
}
};
@ -60,6 +62,8 @@ var testsInfo = {
"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() {

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

@ -456,6 +456,28 @@ async _consoleOpenWithCachedMessagesTest() {
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* () {
@ -738,6 +760,8 @@ async _consoleOpenWithCachedMessagesTest() {
tests["cold.inspector"] = this._coldInspectorOpen;
}
tests["panelsInBackground.reload"] = this._panelsInBackgroundReload;
Object.assign(tests, this._getToolLoadingTests(SIMPLE_URL, "simple", {
expectedMessages: 1,
expectedSources: 1,