blob: 2c8b60fc0f089c84828740f92770ee9497b65d59 [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: 8,
columnNumber: 0
},
options: {
autoContinue: true,
condition: "log('Executing condition'); breakpointBasic(); log('Condition executed'); true;",
actions: [
{type: "evaluate", data: "log('Executing action'); breakpointBasic(); log('Action executed');"}
]
}
};
// This breakpoint should not be hit at all. The only callers are the condition and action
// and breakpoints should be disabled while executing their code.
var breakpointInsideConditonAndAction = {
location: {
scriptId: messageObject.params.scriptId,
lineNumber: 3,
columnNumber: 0
}
};
InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpointInsideConditonAndAction, InspectorProtocol.checkForError);
InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError);
InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function(messageObject) {
InspectorProtocol.checkForError(messageObject);
ProtocolTest.log("PASS: Breakpoint condition and action executed, but the exception did not cause the debugger to pause.")
completeTest();
});
}
}
InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
ProtocolTest.log("FAIL: Paused in debugger: reason = \"" + messageObject.params.reason + "\"");
completeTest();
}
function completeTest()
{
// Reset the pauseOnException state before ending the test.
InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "none"});
ProtocolTest.completeTest();
}
InspectorProtocol.sendCommand("Debugger.enable", {});
InspectorProtocol.sendCommand("Debugger.setBreakpointsActive", {active: true});
}
</script>
</head>
<body onload="runTest()">
<p>The debugger should not pause on exceptions thrown while executing the breakpoint actions.</p>
</body>
</html>