Blame devtools/client/debugger/new/test/mochitest/browser_dbg-breaking.js
|
Packit |
f0b94e |
/* Any copyright is dedicated to the Public Domain.
|
|
Packit |
f0b94e |
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
// Tests the breakpoints are hit in various situations.
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
add_task(async function() {
|
|
Packit |
f0b94e |
const dbg = await initDebugger("doc-scripts.html");
|
|
Packit |
f0b94e |
const { selectors: { getSelectedSource }, getState } = dbg;
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
// Make sure we can set a top-level breakpoint and it will be hit on
|
|
Packit |
f0b94e |
// reload.
|
|
Packit |
f0b94e |
await addBreakpoint(dbg, "scripts.html", 18);
|
|
Packit |
f0b94e |
reload(dbg);
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
await waitForDispatch(dbg, "NAVIGATE");
|
|
Packit |
f0b94e |
await waitForSelectedSource(dbg, "doc-scripts.html");
|
|
Packit |
f0b94e |
await waitForPaused(dbg);
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
assertPausedLocation(dbg);
|
|
Packit |
f0b94e |
await resume(dbg);
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
// Create an eval script that pauses itself.
|
|
Packit |
f0b94e |
invokeInTab("doEval");
|
|
Packit |
f0b94e |
await waitForPaused(dbg);
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
await resume(dbg);
|
|
Packit |
f0b94e |
const source = getSelectedSource(getState()).toJS();
|
|
Packit |
f0b94e |
ok(!source.url, "It is an eval source");
|
|
Packit |
f0b94e |
|
|
Packit |
f0b94e |
await addBreakpoint(dbg, source, 5);
|
|
Packit |
f0b94e |
invokeInTab("evaledFunc");
|
|
Packit |
f0b94e |
await waitForPaused(dbg);
|
|
Packit |
f0b94e |
assertPausedLocation(dbg);
|
|
Packit |
f0b94e |
});
|