blob: 75c6c2e6d73a174ce976abe4a3b27edd15bb624e [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/resources/protocol-test.js"></script>
<script src="resources/breakpoint.js"></script>
<script>
// Put this here instead of on <body onload> to prevent an extra Debugger.scriptParsed event.
window.onload = runTest;
function test()
{
// This test setting 2 breakpoints in DFG compiled functions: one inlined,
// and one not inlined.
InspectorProtocol.sendCommand("Debugger.enable", {});
InspectorProtocol.sendCommand("Debugger.setBreakpointsActive", {active: true});
InspectorProtocol.sendCommand("Debugger.setPauseOnDebuggerStatements", {enabled: true});
var breakpointFound = false;
InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
ProtocolTest.log("Found breakpoint.js");
InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "debuggerStatement();"
}, function(responseObject) {
if (breakpointFound)
ProtocolTest.log("PASS");
ProtocolTest.completeTest();
});
}
}
InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
ProtocolTest.log("Broke at debugger statement\n");
breakpointFound = true;
InspectorProtocol.sendCommand("Debugger.resume", {});
}
}
</script>
</head>
<body>
<p>Debugger statement should break in debugger.</p>
</body>
</html>