blob: ab9c741ee41ec2d44c6156cc9fdce6c8b2016055 [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});
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>