Bug 1318796 - Open the appropriate tool when clicking on a location in the new console; r=jdescottes

We were always opening the debugger when clicking on the location link,
which could be wrong since we can have CSS warnings, or logs coming from Scratchpad.
So we add the function to open in StyleEditor and Scratchpad, and copy some mochitests
that where testing the interaction with those links.


MozReview-Commit-ID: 73mQNfy199m
This commit is contained in:
Nicolas Chevobbe
2016-12-01 08:29:43 +01:00
parent 35119e2362
commit 55a490a50b
18 changed files with 497 additions and 8 deletions

View File

@@ -44,7 +44,21 @@ NewConsoleOutputWrapper.prototype = {
}]));
},
hudProxyClient: this.jsterm.hud.proxy.client,
onViewSourceInDebugger: frame => this.toolbox.viewSourceInDebugger.call(
onViewSourceInDebugger: frame => {
this.toolbox.viewSourceInDebugger.call(
this.toolbox,
frame.url,
frame.line
).then(() =>
this.jsterm.hud.emit("source-in-debugger-opened")
);
},
onViewSourceInScratchpad: frame => this.toolbox.viewSourceInScratchpad.call(
this.toolbox,
frame.url,
frame.line
),
onViewSourceInStyleEditor: frame => this.toolbox.viewSourceInStyleEditor.call(
this.toolbox,
frame.url,
frame.line