blob: 1a36503ecdac551e518093979a15d5d7ae73f118 [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 breakpointId = null;
var scriptId = 0;
var startLine = 0;
InspectorProtocol.eventHandler["Debugger.scriptParsed"] = function(messageObject)
{
if (/resources\/breakpoint\.js$/.test(messageObject.params.url)) {
ProtocolTest.log("Found breakpoint.js");
scriptId = messageObject.params.scriptId;
startLine = messageObject.params.startLine;
InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "dfgWithoutInline2();"
}, function(responseObject) {
ProtocolTest.log("dfg function warmed up\n");
var location1 = {scriptId: scriptId, lineNumber: 2, columnNumber: 0};
InspectorProtocol.sendCommand("Debugger.setBreakpoint", {location: location1}, function(responseObject) {
InspectorProtocol.checkForError(responseObject);
ProtocolTest.log("Breakpoint set in breakpointBasic()");
breakpointId = responseObject.result.breakpointId;
InspectorProtocol.sendCommand("Runtime.evaluate", {
expression: "callNotInlineable2();"
}, function(responseObject) {
ProtocolTest.log("Test complete");
ProtocolTest.completeTest();
});
});
});
}
}
InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject)
{
ProtocolTest.log("Hit Breakpoint!");
var callFrames = messageObject.params.callFrames;
if (callFrames.length < 3)
ProtocolTest.log("FAIL: too few frames in stack trace");
var callFrameId = callFrames[1].callFrameId;
ProtocolTest.log("Evaluating in DFG frame at frame[1]: 'x = 20000;'");
InspectorProtocol.sendCommand("Debugger.evaluateOnCallFrame", { callFrameId: callFrameId, expression: "x = 20000;" }, function(responseObject) {
InspectorProtocol.sendCommand("Debugger.resume", {}, function(responseObject) {
ProtocolTest.log("Resumed from breakpoint");
});
});
}
}
</script>
</head>
<body>
<p>Debugger.evaluateOnCallFrame in a DFG compiled functions.</p>
</body>
</html>