Bug 841954 - Make sure onOpen callback fires in all cases, r=past

This commit is contained in:
Anton Kovalyov 2013-02-18 11:29:20 -08:00
parent 6b503d8a6e
commit 3234f9a902
2 changed files with 15 additions and 4 deletions

View File

@ -470,8 +470,10 @@ ProfilerPanel.prototype = {
panelWin = dbg.panelWin;
let view = dbg.panelWin.DebuggerView;
if (view.Source && view.Sources.selectedValue === data.uri) {
return void view.editor.setCaretPosition(data.line - 1);
if (view.Sources.selectedValue === data.uri) {
view.editor.setCaretPosition(data.line - 1);
onOpen();
return;
}
panelWin.addEventListener("Debugger:SourceShown", onSourceShown, false);

View File

@ -18,9 +18,18 @@ function test() {
let view = dbg.panelWin.DebuggerView;
is(view.Sources.selectedValue, data.uri, "URI is different");
is(view.editor.getCaretPosition().line, data.line - 1, "Line is different");
is(view.editor.getCaretPosition().line, data.line - 1,
"Line is different");
tearDown(tab);
// Test the case where script is already loaded.
view.editor.setCaretPosition(1);
gDevTools.showToolbox(target, "jsprofiler").then(function () {
panel.displaySource(data, function onOpenAgain() {
is(view.editor.getCaretPosition().line, data.line - 1,
"Line is different");
tearDown(tab);
});
});
});
});