Bug 1415532 - Run DAMP test against a document specific to the debugger. r=yulia
MozReview-Commit-ID: Di9a6Mlu3N
--- a/testing/talos/talos/tests/devtools/addon/content/damp.html
+++ b/testing/talos/talos/tests/devtools/addon/content/damp.html
@@ -25,16 +25,17 @@ var defaultConfig = {
"complicated.debugger": true,
"complicated.styleeditor": true,
"complicated.performance": true,
"complicated.netmonitor": true,
"complicated.saveAndReadHeapSnapshot": true,
"custom.webconsole": true,
"custom.inspector": true,
+ "custom.debugger": true,
"console.bulklog": true,
"console.streamlog": true,
"console.objectexpand": true,
"console.openwithcache": true,
"inspector.mutations": true,
}
};
--- a/testing/talos/talos/tests/devtools/addon/content/damp.js
+++ b/testing/talos/talos/tests/devtools/addon/content/damp.js
@@ -497,16 +497,62 @@ async _consoleOpenWithCachedMessagesTest
let url = CUSTOM_URL.replace(/\$TOOL/, "console");
await this.testSetup(url);
let toolbox = await this.openToolboxAndLog("custom.webconsole", "webconsole");
await this.reloadConsoleAndLog("custom", toolbox, 500);
await this.closeToolboxAndLog("custom.webconsole");
await this.testTeardown();
},
+ async openDebuggerAndLog(label, expectedSources) {
+ let onLoad = async function(toolbox, dbg) {
+ await new Promise(done => {
+ let { selectors, store } = dbg.panelWin.getGlobalsForTesting();
+ let unsubscribe;
+ function countSources() {
+ const sources = selectors.getSources(store.getState());
+ if (sources.size >= expectedSources) {
+ unsubscribe();
+ done();
+ }
+ }
+ unsubscribe = store.subscribe(countSources);
+ countSources();
+ });
+ };
+ let toolbox = await this.openToolboxAndLog(label + ".jsdebugger", "jsdebugger", onLoad);
+ return toolbox;
+ },
+
+ async reloadDebuggerAndLog(label, toolbox, expectedSources) {
+ let onReload = async function() {
+ await new Promise(done => {
+ let count = 0;
+ let { client } = toolbox.target;
+ let onSource = async (_, actor) => {
+ if (++count >= expectedSources) {
+ client.removeListener("newSource", onSource);
+ done();
+ }
+ };
+ client.addListener("newSource", onSource);
+ });
+ };
+ await this.reloadPageAndLog(label + ".jsdebugger", onReload);
+ },
+
+ async customDebugger() {
+ let url = CUSTOM_URL.replace(/\$TOOL/, "debugger");
+ await this.testSetup(url);
+ let toolbox = await this.openDebuggerAndLog(label);
+ await this.reloadDebuggerAndLog(label, toolbox);
+ await this.closeToolboxAndLog(label + ".jsdebugger");
+ await this.testTeardown();
+ },
+
_getToolLoadingTests(url, label, { expectedMessages, expectedSources }) {
let tests = {
async inspector() {
await this.testSetup(url);
let toolbox = await this.openToolboxAndLog(label + ".inspector", "inspector");
await this.reloadInspectorAndLog(label, toolbox);
await this.closeToolboxAndLog(label + ".inspector");
await this.testTeardown();
@@ -517,46 +563,18 @@ async _consoleOpenWithCachedMessagesTest
let toolbox = await this.openToolboxAndLog(label + ".webconsole", "webconsole");
await this.reloadConsoleAndLog(label, "webconsole", expectedMessages);
await this.closeToolboxAndLog(label + ".webconsole");
await this.testTeardown();
},
async debugger() {
await this.testSetup(url);
- let onLoad = async function(toolbox, dbg) {
- await new Promise(done => {
- let { selectors, store } = dbg.panelWin.getGlobalsForTesting();
- let unsubscribe;
- function countSources() {
- const sources = selectors.getSources(store.getState());
- if (sources.size >= expectedSources) {
- unsubscribe();
- done();
- }
- }
- unsubscribe = store.subscribe(countSources);
- countSources();
- });
- };
- let toolbox = await this.openToolboxAndLog(label + ".jsdebugger", "jsdebugger", onLoad);
- let onReload = async function() {
- await new Promise(done => {
- let count = 0;
- let { client } = toolbox.target;
- let onSource = async (_, actor) => {
- if (++count >= expectedSources) {
- client.removeListener("newSource", onSource);
- done();
- }
- };
- client.addListener("newSource", onSource);
- });
- };
- await this.reloadPageAndLog(label + ".jsdebugger", onReload);
+ let toolbox = await this.openDebuggerAndLog(label, expectedSources);
+ await this.reloadDebuggerAndLog(label, toolbox, expectedSources);
await this.closeToolboxAndLog(label + ".jsdebugger");
await this.testTeardown();
},
async styleeditor() {
await this.testSetup(url);
await this.openToolboxAndLog(label + ".styleeditor", "styleeditor");
await this.reloadPageAndLog(label + ".styleeditor");
@@ -774,16 +792,17 @@ async _consoleOpenWithCachedMessagesTest
Object.assign(tests, this._getToolLoadingTests(COMPLICATED_URL, "complicated", {
expectedMessages: 7,
expectedSources: 14,
}));
// Run all tests against a document specific to each tool
tests["custom.inspector"] = this.customInspector;
tests["custom.webconsole"] = this.customConsole;
+ tests["custom.debugger"] = this.customDebugger;
// Run individual tests covering a very precise tool feature
tests["console.bulklog"] = this._consoleBulkLoggingTest;
tests["console.streamlog"] = this._consoleStreamLoggingTest;
tests["console.objectexpand"] = this._consoleObjectExpansionTest;
tests["console.openwithcache"] = this._consoleOpenWithCachedMessagesTest;
tests["inspector.mutations"] = this._inspectorMutationsTest;