Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: LayoutTests/inspector/sources/debugger/script-failed-to-parse.html

Issue 881263002: DevTools: use target-based model accessors only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script> 4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script> 5 <script>
6 function addScript(url) 6 function addScript(url)
7 { 7 {
8 var head = document.getElementsByTagName('head')[0]; 8 var head = document.getElementsByTagName('head')[0];
9 var script = document.createElement('script'); 9 var script = document.createElement('script');
10 script.setAttribute('src', url); 10 script.setAttribute('src', url);
11 head.appendChild(script); 11 head.appendChild(script);
12 } 12 }
13 13
14 function test() 14 function test()
15 { 15 {
16 InspectorTest.runDebuggerTestSuite([ 16 InspectorTest.runDebuggerTestSuite([
17 function testScriptParsedEvent(next) 17 function testScriptParsedEvent(next)
18 { 18 {
19 WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerMod el.Events.FailedToParseScriptSource, scriptFailedToParse); 19 InspectorTest.debuggerModel.addEventListener(WebInspector.DebuggerMo del.Events.FailedToParseScriptSource, scriptFailedToParse);
20 InspectorTest.evaluateInPage("addScript('resources/script-failed-to- parse.js')"); 20 InspectorTest.evaluateInPage("addScript('resources/script-failed-to- parse.js')");
21 21
22 function scriptFailedToParse(event) 22 function scriptFailedToParse(event)
23 { 23 {
24 var script = event.data; 24 var script = event.data;
25 if (script.sourceURL.indexOf("script-failed-to-parse.js") !== -1 ) { 25 if (script.sourceURL.indexOf("script-failed-to-parse.js") !== -1 ) {
26 InspectorTest.addResult("Event with script-failed-to-parse.j s received"); 26 InspectorTest.addResult("Event with script-failed-to-parse.j s received");
27 WebInspector.debuggerModel.removeEventListener(WebInspector. DebuggerModel.Events.FailedToParseScriptSource, scriptFailedToParse); 27 InspectorTest.debuggerModel.removeEventListener(WebInspector .DebuggerModel.Events.FailedToParseScriptSource, scriptFailedToParse);
28 next(); 28 next();
29 } 29 }
30 } 30 }
31 }, 31 },
32 ]); 32 ]);
33 } 33 }
34 </script> 34 </script>
35 </head> 35 </head>
36 <body onload="runTest()"> 36 <body onload="runTest()">
37 <p> 37 <p>
38 Tests that FailedToParseScriptSource event is raised after compile script with s yntax error. 38 Tests that FailedToParseScriptSource event is raised after compile script with s yntax error.
39 </p> 39 </p>
40 </body> 40 </body>
41 </html> 41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698