blob: 5f550782bcd2731b27350b5f2a06673685ece9f6 [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("AssertionsBreakpoint", "Should not pause on assertion failure.", "assertFalse()", WI.debuggerManager.assertionsBreakpoint);
addTestCase("AllUncaughtExceptionsBreakpoint", "Should not pause on uncaught exception.", "doThrow()", WI.debuggerManager.allUncaughtExceptionsBreakpoint);
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>