Bug 1315289 - Use correct API for opening a source in the debugger r=me

This commit is contained in:
James Long 2016-11-07 13:10:03 -05:00
Родитель 93e8d4acf8
Коммит 8ad312e3e3
2 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -62,7 +62,7 @@ exports.viewSourceInDebugger = Task.async(function* (toolbox, sourceURL, sourceL
yield toolbox.selectTool("jsdebugger");
const source = dbg._selectors().getSourceByURL(dbg._getState(), sourceURL);
if (source) {
dbg._actions().selectSourceByURL(sourceURL, { line: sourceLine });
dbg._actions().selectSourceURL(sourceURL, { line: sourceLine });
return true;
}

Просмотреть файл

@ -11,8 +11,9 @@
const TEST_URI = "http://example.com/browser/devtools/client/webconsole/test" +
"/test-bug-766001-js-console-links.html";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
// Force the new debugger UI, in case this gets uplifted with the old
// debugger still turned on
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", true);
registerCleanupFunction(function* () {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
@ -79,10 +80,9 @@ function test() {
yield hud.ui.once("source-in-debugger-opened");
let toolbox = yield gDevTools.getToolbox(hud.target);
let {panelWin: { DebuggerView: view }} = toolbox.getPanel("jsdebugger");
is(view.Sources.selectedValue,
getSourceActor(view.Sources, url),
let dbg = toolbox.getPanel("jsdebugger");
is(dbg._selectors().getSelectedSource(dbg._getState()).get("url"),
url,
"expected source url");
is(view.editor.getCursor().line, line - 1, "expected source line");
}
}