Dactyloidae/devtools/client/debugger/test/mochitest/browser_dbg_breakpoints-other-tabs.js
Moonchild 8c395520d9 Issue #1656 - Part 1: Nuke most vim config lines in the tree.
Since these are just interpreted comments, there's 0 impact on actual code.
This removes all lines that match /* vim: set(.*)tw=80: */ with S&R -- there are
a few others scattered around which will be removed manually in a second part.
2020-09-25 22:04:12 +08:00

40 lines
1.4 KiB
JavaScript

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Make sure that setting a breakpoint in one tab, doesn't cause another tab at
* the same source to pause at that location.
*/
const TAB_URL = EXAMPLE_URL + "doc_breakpoints-other-tabs.html";
var test = Task.async(function* () {
const options = {
source: EXAMPLE_URL + "code_breakpoints-other-tabs.js",
line: 1
};
const [tab1,, panel1] = yield initDebugger(TAB_URL, options);
const [tab2,, panel2] = yield initDebugger(TAB_URL, options);
const queries = panel1.panelWin.require("./content/queries");
const actions = bindActionCreators(panel1);
const getState = panel1.panelWin.DebuggerController.getState;
const sources = panel1.panelWin.DebuggerView.Sources;
yield actions.addBreakpoint({
actor: queries.getSelectedSource(getState()).actor,
line: 2
});
const paused = waitForThreadEvents(panel2, "paused");
callInTab(tab2, "testCase");
const packet = yield paused;
is(packet.why.type, "debuggerStatement",
"Should have stopped at the debugger statement, not the other tab's breakpoint");
is(packet.frame.where.line, 3,
"Should have stopped at line 3 (debugger statement), not line 2 (other tab's breakpoint)");
yield resumeDebuggerThenCloseAndFinish(panel2);
});