зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1419533 - Add talos test for devtools inspector layout tab;r=ochameau
MozReview-Commit-ID: 7Ayx8XG2GJp --HG-- extra : rebase_source : 9b2971d1c4451e3e8d571bbd602aa921cb025fa1 extra : source : 29d1ede5df56d36cede93236519b27b15b841e9b
This commit is contained in:
Родитель
5c75d26539
Коммит
6c7c5ad2f0
|
@ -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.
|
||||
*/
|
||||
_inspectorLayoutTest: Task.async(function* () {
|
||||
let tab = yield 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.
|
||||
yield 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();
|
||||
yield this.openToolbox("inspector");
|
||||
this._results.push({
|
||||
name: "inspector.layout.open",
|
||||
value: performance.now() - start
|
||||
});
|
||||
|
||||
yield this.closeToolbox(null);
|
||||
|
||||
// Restore sidebar tab preference.
|
||||
Services.prefs.setCharPref("devtools.inspector.activeSidebar", sidebarTab);
|
||||
|
||||
yield 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", "");
|
||||
|
|
Загрузка…
Ссылка в новой задаче