blob: 7348c35635abb7c52f010ce81a4a1d8c07e8aa37 [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/resources/protocol-test.js"></script>
<script src="resources/breakpoint.js"></script>
<script>
function test()
{
InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
ProtocolTest.log("Found breakpoint.js");
var breakpoint = {
location: {
scriptId: messageObject.params.scriptId,
lineNumber: 3,
columnNumber: 0
}
};
InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError);
InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointBasic()"}, function() {
completeTest();
});
}
}
InspectorProtocol.eventHandler["Debugger.paused"] = onBreakpointHit;
function onBreakpointHit(messageObject)
{
ProtocolTest.log("PASS: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
// Make sure we do not pause again in the debugger.
InspectorProtocol.eventHandler["Debugger.paused"] = onPausedOnException;
InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "this.should.trigger.an.exception"}, function(messageObject) {
InspectorProtocol.checkForError(messageObject);
ProtocolTest.log("PASS: The debugger should not stop on the exception thrown by a console command while paused on a breakpoint.");
InspectorProtocol.sendCommand("Debugger.resume");
});
}
function onPausedOnException(messageObject)
{
ProtocolTest.log("FAIL: Should not break on exceptions while paused on a breakpoint.");
completeTest();
}
function completeTest()
{
// InspectorProtocol.sendCommand("Debugger.resume", {});
// Reset the pauseOnException state before ending the test.
InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
InspectorProtocol.sendCommand("Debugger.disable");
ProtocolTest.completeTest();
}
InspectorProtocol.sendCommand("Debugger.enable", {});
InspectorProtocol.sendCommand("Debugger.setBreakpointsActive", {active: true});
}
</script>
</head>
<body onload="runTest()">
<p>While being paused on a breakpoint the debugger should ignore the exceptions from console commands.</p>
</body>
</html>