Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-message-from-inline-with-url.html
blob17c864ea0af6c633ce3b63b85f3f5cee4a45317e
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script>
6 function foo()
8 console.log("foo");
10 function addInlineWithSyntaxError()
12 var headElement = document.getElementsByTagName("head")[0];
13 var scriptElement = document.createElement("script");
14 scriptElement.setAttribute("type", "text/javascript");
15 headElement.appendChild(scriptElement);
16 scriptElement.text = "}\n//# sourceURL=boo.js";
18 //# sourceURL=foo.js
19 </script>
20 <script>
21 function test()
23 InspectorTest.evaluateInPage("setTimeout(foo, 0);", InspectorTest.waitUntilMessageReceived.bind(this, step2));
25 function step2()
27 InspectorTest.evaluateInPage("setTimeout(addInlineWithSyntaxError, 0);", InspectorTest.waitUntilMessageReceived.bind(this, step3));
30 function step3()
32 InspectorTest.dumpConsoleMessages();
33 InspectorTest.completeTest();
36 </script>
37 </head>
38 <body onload="runTest()">
39 <p>
40 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.
41 </p>
42 </body>
43 </html>