blob: d431baa0c92bcfcee7966e31a73d7ee6025244be [file] [log] [blame]
<html>
<head>
<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
<script>
function bar()
{
return 42;
}
</script>
<script>
function foo()
{
var a = bar();
return a + 1;
}
//# sourceURL=foo.js
</script>
<script>
function qwe()
{
var a = foo();
return a + 1;
}
//# sourceURL=qwe.js
</script>
<script>
function baz()
{
var a = qwe();
return a + 1;
}
//# sourceURL=baz.js
</script>
<script>
function test()
{
InspectorTest.sendCommand("Debugger.enable", {});
InspectorTest.sendCommand("Debugger.setBlackboxPatterns", { patterns: [ "foo([" ] }, dumpError);
function dumpError(message)
{
InspectorTest.log(message.error.message);
InspectorTest.eventHandler["Debugger.paused"] = dumpStackAndRunNextCommand;
InspectorTest.sendCommandOrDie("Debugger.setBlackboxPatterns", { patterns: [ "baz\.js", "foo\.js" ] });
InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "debugger;baz()" });
}
var commands = [ "stepInto", "stepInto", "stepInto", "stepOut", "stepInto", "stepInto" ];
function dumpStackAndRunNextCommand(message)
{
InspectorTest.log("Paused in");
var callFrames = message.params.callFrames;
for (var callFrame of callFrames)
InspectorTest.log((callFrame.functionName || "(...)") + ":" + (callFrame.location.lineNumber + 1));
var command = commands.shift();
if (!command) {
InspectorTest.completeTest();
return;
}
InspectorTest.sendCommandOrDie("Debugger." + command, {});
}
}
</script>
</head>
<body onLoad="runTest();"></body>
</html>