OLD | NEW |
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 src="../editor/editor-test.js"></script> | 5 <script src="../editor/editor-test.js"></script> |
6 <script src="./debugger/resources/edit-me.js"></script> | 6 <script src="./debugger/resources/edit-me.js"></script> |
7 <script> | 7 <script> |
8 | 8 |
9 function test() | 9 function test() |
10 { | 10 { |
11 InspectorTest.showScriptSource("edit-me.js", onSourceFrame); | 11 InspectorTest.showScriptSource("edit-me.js", onSourceFrame); |
12 | 12 |
13 function onSourceFrame(sourceFrame) | 13 function onSourceFrame(sourceFrame) |
14 { | 14 { |
15 InspectorTest.addSniffer(WebInspector.JavaScriptCompiler.prototype, "_co
mpilationFinishedForTest", onCompilationFinished.bind(null, sourceFrame)); | 15 InspectorTest.addSniffer(WebInspector.JavaScriptCompiler.prototype, "_co
mpilationFinishedForTest", onCompilationFinished.bind(null, sourceFrame)); |
16 sourceFrame.textEditor.setSelection(WebInspector.TextRange.createFromLoc
ation(0, 0)); | 16 sourceFrame.textEditor.setSelection(WebInspector.TextRange.createFromLoc
ation(0, 0)); |
17 InspectorTest.typeIn(sourceFrame.textEditor, "test!"); | 17 InspectorTest.typeIn(sourceFrame.textEditor, "test!"); |
18 } | 18 } |
19 | 19 |
20 function onCompilationFinished(sourceFrame) | 20 function onCompilationFinished(sourceFrame) |
21 { | 21 { |
22 for (var line in sourceFrame._rowMessageBuckets) { | 22 for (var line in sourceFrame._rowMessageBuckets) { |
23 var bubble = sourceFrame._rowMessageBuckets[line]; | 23 var bubble = sourceFrame._rowMessageBuckets[line]; |
24 for (var rowMessage of bubble._messages) { | 24 for (var rowMessage of bubble._messages) { |
25 var message = rowMessage.message(); | 25 var message = rowMessage.message(); |
26 InspectorTest.addResult(String.sprintf("%d:%d [%s] %s", message.
lineNumber(), message.columnNumber(), message.level(), message.messageText())); | 26 InspectorTest.addResult(String.sprintf("%d:%d [%s] %s", message.
lineNumber(), message.columnNumber(), message.level(), message.text())); |
27 } | 27 } |
28 } | 28 } |
29 InspectorTest.completeTest(); | 29 InspectorTest.completeTest(); |
30 } | 30 } |
31 } | 31 } |
32 | 32 |
33 </script> | 33 </script> |
34 | 34 |
35 </head> | 35 </head> |
36 | 36 |
37 <body onload="runTest()"> | 37 <body onload="runTest()"> |
38 <p>Verifies proactive javascript compilation.</p> | 38 <p>Verifies proactive javascript compilation.</p> |
39 </body> | 39 </body> |
40 </html> | 40 </html> |
OLD | NEW |