| <html> |
| <head> |
| <script src="../../http/tests/inspector/inspector-test.js"></script> |
| <script src="highlighter-test.js"></script> |
| <script> |
| |
| function test() |
| { |
| |
| var singleLine = "this.field = this.field = \"foo\"; /* comment here */ this.otherField = 12; // end of line\n"; |
| src = ""; |
| for (var i = 0; i < 10; ++i) |
| src += singleLine; |
| |
| var textModel = new WebInspector.TextEditorModel(); |
| textModel.setText(src); |
| |
| function damageCallback(startLine, endLine) |
| { |
| if (endLine === textModel.linesCount) { |
| InspectorTest.addResult("Highlighter results"); |
| InspectorTest.dumpTextModel(textModel); |
| InspectorTest.completeTest(); |
| } |
| } |
| |
| var highlighter = new WebInspector.TextEditorHighlighter(textModel, damageCallback); |
| highlighter.mimeType = "text/javascript"; |
| highlighter.highlightChunkLimit = 3; |
| highlighter.highlight(textModel.linesCount); |
| } |
| |
| </script> |
| </head> |
| |
| <body onload="runTest()"> |
| <p> |
| This test checks highlighting with specific highlightChunkLimit. |
| </p> |
| |
| </body> |
| </html> |