blob: b68779ea163793d97fd0db491c6e6a21e95298ac [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
<script src="resources/assert.js"></script>
<script src="resources/break-on-exception-tests.js"></script>
<script>
TestPage.allowUncaughtExceptions = true;
function test()
{
let suite = InspectorTest.createAsyncSuite("BreakpointsDisabled");
function addTestCase(name, description, expression, breakpoint) {
suite.addTestCase({
name,
description,
test(resolve, reject) {
let didPause = false;
let listener = WI.debuggerManager.singleFireEventListener(WI.DebuggerManager.Event.Paused, (event) => {
didPause = true;
InspectorTest.fail("Should not have paused.");
WI.debuggerManager.resume();
reject();
});
breakpoint.disabled = false;
WI.debuggerManager.breakpointsEnabled = false;
InspectorTest.evaluateInPage(expression, () => {
InspectorTest.expectFalse(didPause, "Should not pause.")
WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, listener);
WI.debuggerManager.resume();
resolve();
});
}
});
}
addTestCase("AssertionFailuresBreakpoint", "Should not pause on assertion failure.", "assertFalse()", WI.debuggerManager.assertionFailuresBreakpoint);
addTestCase("UncaughtExceptionsBreakpoint", "Should not pause on uncaught exception.", "doThrow()", WI.debuggerManager.uncaughtExceptionsBreakpoint);
addTestCase("AllExceptionsBreakpoint", "Should not pause on caught exception.", "testCatch()", WI.debuggerManager.allExceptionsBreakpoint);
suite.runTestCasesAndFinish();
}
</script>
</head>
<body onload="runTest()">
<p>Check that special breakpoints aren't hit when breakpoints are disabled.</p>
</body>
</html>