Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger / script-failed-to-parse.html
blobaaa0fb362f23f17d92b589985564f20f321c4ed4
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script>
6 function addScript(url)
8 var head = document.getElementsByTagName('head')[0];
9 var script = document.createElement('script');
10 script.setAttribute('src', url);
11 head.appendChild(script);
14 function test()
16 InspectorTest.runDebuggerTestSuite([
17 function testScriptParsedEvent(next)
19 InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, scriptFailedToParse);
20 InspectorTest.evaluateInPage("addScript('resources/script-failed-to-parse.js')");
22 function scriptFailedToParse(event)
24 var script = event.data;
25 if (script.sourceURL.indexOf("script-failed-to-parse.js") !== -1) {
26 InspectorTest.addResult("Event with script-failed-to-parse.js received");
27 InspectorTest.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, scriptFailedToParse);
28 next();
32 ]);
34 </script>
35 </head>
36 <body onload="runTest()">
37 <p>
38 Tests that FailedToParseScriptSource event is raised after compile script with syntax error.
39 </p>
40 </body>
41 </html>