mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1930687 - [devtools] Fix the restoring of pause on caught exception when opening DevTools. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D228686
This commit is contained in:
parent
40c90a3a09
commit
e495a2afea
@ -61,10 +61,10 @@ function setPauseOnDebuggerStatement() {
|
||||
}
|
||||
|
||||
function setPauseOnExceptions() {
|
||||
const { pauseOnExceptions, pauseOnCaughtException } = prefs;
|
||||
const { pauseOnExceptions, pauseOnCaughtExceptions } = prefs;
|
||||
return firefox.clientCommands.pauseOnExceptions(
|
||||
pauseOnExceptions,
|
||||
pauseOnCaughtException
|
||||
pauseOnCaughtExceptions
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -133,6 +133,37 @@ add_task(async function () {
|
||||
await resume(dbg);
|
||||
});
|
||||
|
||||
add_task(async function testSettingAppliedOnStartup() {
|
||||
let dbg = await initDebugger("doc-exceptions.html", "exceptions.js");
|
||||
|
||||
await togglePauseOnExceptions(dbg, true, true);
|
||||
|
||||
await dbg.toolbox.closeToolbox();
|
||||
|
||||
// Do not use `initDebugger` as it resets all settings
|
||||
const toolbox = await openNewTabAndToolbox(
|
||||
EXAMPLE_URL + "doc-exceptions.html",
|
||||
"jsdebugger"
|
||||
);
|
||||
dbg = createDebuggerContext(toolbox);
|
||||
|
||||
await waitForSource(dbg, "exceptions.js");
|
||||
|
||||
const pauseOnCaughtExceptionCheckbox = findElementWithSelector(
|
||||
dbg,
|
||||
".breakpoints-exceptions-caught input"
|
||||
);
|
||||
ok(pauseOnCaughtExceptionCheckbox.checked, "The settings is visualy enabled");
|
||||
|
||||
uncaughtException();
|
||||
await waitForPaused(dbg);
|
||||
await assertPausedAtSourceAndLine(
|
||||
dbg,
|
||||
findSource(dbg, "exceptions.js").id,
|
||||
2
|
||||
);
|
||||
});
|
||||
|
||||
function uncaughtException() {
|
||||
return invokeInTab("uncaughtException").catch(() => {});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user