blob: 152fb7c972ec48edfea622604804a0872c14cfb3 [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: "else", // a bad script that should fail to parse.
action: [
{type: "log", data: "FAIL: The breakpoint action should not be executed if the condition had an exception."}
]
}
};
InspectorProtocol.sendCommand("Debugger.setBreakpoint", breakpoint, InspectorProtocol.checkForError);
InspectorProtocol.sendCommand("Runtime.evaluate", {expression: "breakpointWithCondition(1,2)"}, function() {
ProtocolTest.log("PASS: The VM should not crash.");
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.
ProtocolTest.completeTest();
}
InspectorProtocol.sendCommand("Debugger.enable", {});
InspectorProtocol.sendCommand("Debugger.setBreakpointsActive", {active: true});
}
</script>
</head>
<body onload="runTest()">
<p>The debugger should not crash when executing a bad script for testing a breakpoint condition.</p>
</body>
</html>