mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 07:45:30 +00:00
Bug 1419533 - Add talos test for devtools inspector layout tab;r=ochameau
MozReview-Commit-ID: 7Ayx8XG2GJp --HG-- extra : rebase_source : b3b00d371deb150d325d38451fff0b5bed811e99 extra : source : 29d1ede5df56d36cede93236519b27b15b841e9b
This commit is contained in:
parent
80652afe02
commit
3d20c50c12
@ -35,6 +35,7 @@ var defaultConfig = {
|
||||
"console.objectexpand": true,
|
||||
"console.openwithcache": true,
|
||||
"inspector.mutations": true,
|
||||
"inspector.layout": true,
|
||||
|
||||
"panelsInBackground.reload": true,
|
||||
}
|
||||
@ -64,6 +65,7 @@ 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",
|
||||
"inspector.layout": "Measure the time to open/close toolbox on inspector with layout tab against big document with grid containers",
|
||||
|
||||
"panelsInBackground.reload": "Measure page reload time when all panels are in background",
|
||||
};
|
||||
|
@ -338,7 +338,7 @@ async _consoleOpenWithCachedMessagesTest() {
|
||||
},
|
||||
|
||||
/**
|
||||
* Measure the time necesssary to perform successive childList mutations in the content
|
||||
* Measure the time necessary to perform successive childList mutations in the content
|
||||
* page and update the markup-view accordingly.
|
||||
*/
|
||||
async _inspectorMutationsTest() {
|
||||
@ -394,6 +394,54 @@ async _consoleOpenWithCachedMessagesTest() {
|
||||
await this.testTeardown();
|
||||
},
|
||||
|
||||
/**
|
||||
* Measure the time to open toolbox on the inspector with the layout tab selected.
|
||||
*/
|
||||
async _inspectorLayoutTest() {
|
||||
let tab = await this.testSetup(SIMPLE_URL);
|
||||
let messageManager = tab.linkedBrowser.messageManager;
|
||||
|
||||
// Backup current sidebar tab preference
|
||||
let sidebarTab = Services.prefs.getCharPref("devtools.inspector.activeSidebar");
|
||||
|
||||
// Set layoutview as the current inspector sidebar tab.
|
||||
Services.prefs.setCharPref("devtools.inspector.activeSidebar", "layoutview");
|
||||
|
||||
// Setup test page. It is a simple page containing 5000 regular nodes and 10 grid
|
||||
// containers.
|
||||
await new Promise(resolve => {
|
||||
messageManager.addMessageListener("setup-test-done", resolve);
|
||||
|
||||
const NODES = 5000;
|
||||
const GRID_NODES = 10;
|
||||
messageManager.loadFrameScript("data:,(" + encodeURIComponent(
|
||||
`function () {
|
||||
let div = content.document.createElement("div");
|
||||
div.innerHTML =
|
||||
new Array(${NODES}).join("<div></div>") +
|
||||
new Array(${GRID_NODES}).join("<div style='display:grid'></div>");
|
||||
content.document.body.appendChild(div);
|
||||
sendSyncMessage("setup-test-done");
|
||||
}`
|
||||
) + ")()", false);
|
||||
});
|
||||
|
||||
// Open the toolbox and record the time.
|
||||
let start = performance.now();
|
||||
await this.openToolbox("inspector");
|
||||
this._results.push({
|
||||
name: "inspector.layout.open",
|
||||
value: performance.now() - start
|
||||
});
|
||||
|
||||
await this.closeToolbox(null);
|
||||
|
||||
// Restore sidebar tab preference.
|
||||
Services.prefs.setCharPref("devtools.inspector.activeSidebar", sidebarTab);
|
||||
|
||||
await this.testTeardown();
|
||||
},
|
||||
|
||||
takeCensus(label) {
|
||||
let start = performance.now();
|
||||
|
||||
@ -796,6 +844,7 @@ async _consoleOpenWithCachedMessagesTest() {
|
||||
tests["console.objectexpand"] = this._consoleObjectExpansionTest;
|
||||
tests["console.openwithcache"] = this._consoleOpenWithCachedMessagesTest;
|
||||
tests["inspector.mutations"] = this._inspectorMutationsTest;
|
||||
tests["inspector.layout"] = this._inspectorLayoutTest;
|
||||
|
||||
// Filter tests via `./mach --subtests filter` command line argument
|
||||
let filter = Services.prefs.getCharPref("talos.subtests", "");
|
||||
|
Loading…
Reference in New Issue
Block a user