Bug 1201008 - only add a breakpoint in the debugger if a source is actually loaded. r=bgrins

--HG--
extra : rebase_source : 8af6cdc227f09dc528ce27e26b4f0054d7f6f0d2
This commit is contained in:
James Long 2015-10-21 10:55:00 +02:00
Родитель 64050c40ce
Коммит 717071e509
3 изменённых файлов: 29 добавлений и 1 удалений

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

@ -311,7 +311,10 @@ var DebuggerView = {
if (button == 2) {
this.clickedLine = line;
}
else {
// Bug 1201008: Only add the breakpoint to the editor if we're currently
// looking at a source. Even if no source is loaded, you can
// interact with line 1 of the editor.
else if (DebuggerView.Sources.selectedValue) {
if (this.editor.hasBreakpoint(line)) {
this.editor.removeBreakpoint(line);
} else {

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

@ -289,6 +289,8 @@ skip-if = e10s # TODO
skip-if = e10s # TODO
[browser_dbg_navigation.js]
skip-if = e10s && debug
[browser_dbg_no-dangling-breakpoints.js]
skip-if = e10s && debug
[browser_dbg_no-page-sources.js]
skip-if = e10s && debug
[browser_dbg_on-pause-highlight.js]

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

@ -0,0 +1,23 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Bug 1201008 - Make sure you can't set a breakpoint in a blank
* editor
*/
function test() {
initDebugger('data:text/html,hi').then(([aTab,, aPanel]) => {
const gPanel = aPanel;
const gDebugger = gPanel.panelWin;
Task.spawn(function*() {
const editor = gDebugger.DebuggerView.editor;
editor.emit("gutterClick", 0);
is(editor.getBreakpoints().length, 0,
"A breakpoint should not exist");
closeDebuggerAndFinish(gPanel);
});
});
}