blob: 17c864ea0af6c633ce3b63b85f3f5cee4a45317e [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/console-test.js"></script>
<script>
function foo()
{
console.log("foo");
}
function addInlineWithSyntaxError()
{
var headElement = document.getElementsByTagName("head")[0];
var scriptElement = document.createElement("script");
scriptElement.setAttribute("type", "text/javascript");
headElement.appendChild(scriptElement);
scriptElement.text = "}\n//# sourceURL=boo.js";
}
//# sourceURL=foo.js
</script>
<script>
function test()
{
InspectorTest.evaluateInPage("setTimeout(foo, 0);", InspectorTest.waitUntilMessageReceived.bind(this, step2));
function step2()
{
InspectorTest.evaluateInPage("setTimeout(addInlineWithSyntaxError, 0);", InspectorTest.waitUntilMessageReceived.bind(this, step3));
}
function step3()
{
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
}
</script>
</head>
<body onload="runTest()">
<p>
Tests that log message and syntax errors from inline scripts with sourceURL are logged into console, contains correct link and doesn't cause browser crash.
</p>
</body>
</html>