OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
4 <script src="highlighter-test.js"></script> | |
5 <script> | |
6 | |
7 function test() | |
8 { | |
9 | |
10 var singleLine = "this.field = this.field = \"foo\"; /* comment here */ this
.otherField = 12; // end of line\n"; | |
11 src = ""; | |
12 for (var i = 0; i < 10; ++i) | |
13 src += singleLine; | |
14 | |
15 var textModel = new WebInspector.TextEditorModel(); | |
16 textModel.setText(src); | |
17 | |
18 function damageCallback(startLine, endLine) | |
19 { | |
20 if (endLine === textModel.linesCount) { | |
21 InspectorTest.addResult("Highlighter results"); | |
22 InspectorTest.dumpTextModel(textModel); | |
23 InspectorTest.completeTest(); | |
24 } | |
25 } | |
26 | |
27 var highlighter = new WebInspector.TextEditorHighlighter(textModel, damageCa
llback); | |
28 highlighter.mimeType = "text/javascript"; | |
29 highlighter.highlightChunkLimit = 3; | |
30 highlighter.highlight(textModel.linesCount); | |
31 } | |
32 | |
33 </script> | |
34 </head> | |
35 | |
36 <body onload="runTest()"> | |
37 <p> | |
38 This test checks highlighting with specific highlightChunkLimit. | |
39 </p> | |
40 | |
41 </body> | |
42 </html> | |
OLD | NEW |