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

Side by Side Diff: LayoutTests/inspector/editor/highlighter-basics.html

Issue 22638008: DevTools: Use CodeMirror modes instead of highlight tokenizers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address comments Created 7 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/inspector/editor/highlighter-basics-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 var src = "/**\n";
10 for (var i = 1; i < 9; ++i) {
11 src += " * line #" + i + "\n";
12 }
13 src += " * var a = new A(); //*/\n";
14 src += "some text\n";
15
16 var textModel = new WebInspector.TextEditorModel();
17 textModel.setText(src);
18
19 var highlighter = new WebInspector.TextEditorHighlighter(textModel, function () {});
20 highlighter.mimeType = "text/javascript";
21 highlighter.highlightChunkLimit = Number.MAX_VALUE; // Synchronous.
22
23 function dumpTextModel(msg) {
24 InspectorTest.addResult("\n" + msg);
25 InspectorTest.dumpTextModel(textModel);
26 }
27
28 highlighter.highlight(5);
29 dumpTextModel("After highlighting 5 lines");
30
31 highlighter.highlight(textModel.linesCount);
32 dumpTextModel("After highlighting all lines");
33
34 var range = new WebInspector.TextRange(3, 0, 6, 0);
35 var newRange = textModel.editRange(range, src);
36 dumpTextModel("After changing text model, but before updating highlights");
37
38 highlighter.updateHighlight(newRange.startLine, newRange.endLine + 1);
39 dumpTextModel("After updating highlights");
40
41 highlighter.highlight(textModel.linesCount, true);
42 dumpTextModel("After highlighting up to the end");
43
44 var range = new WebInspector.TextRange(0, 0, 0, textModel.lineLength(0));
45 var newRange = textModel.editRange(range, "foo /* comment */");
46 highlighter.updateHighlight(0, 5);
47 dumpTextModel("After changing the first line, and updating the highlights fo r the first 5 lines");
48
49 var range = new WebInspector.TextRange(0, textModel.lineLength(0), 0, textMo del.lineLength(0));
50 var newRange = textModel.editRange(range, " /*");
51 highlighter.updateHighlight(0, 2);
52 dumpTextModel("Again change the first line, but update only first 2 lines (i nvalidate update for the lines below)");
53
54 InspectorTest.completeTest();
55 }
56
57 </script>
58 </head>
59
60 <body onload="runTest()">
61 <p>
62 This test checks highlighter correctness.
63 </p>
64
65 </body>
66 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector/editor/highlighter-basics-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698