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

Unified Diff: LayoutTests/inspector/editor/highlighter-long-line.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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/inspector/editor/highlighter-long-line.html
diff --git a/LayoutTests/inspector/editor/highlighter-long-line.html b/LayoutTests/inspector/editor/highlighter-long-line.html
deleted file mode 100644
index fc5d58765516983914c2e777c1a3a40bd6b4d84c..0000000000000000000000000000000000000000
--- a/LayoutTests/inspector/editor/highlighter-long-line.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<html>
-<head>
-<script src="../../http/tests/inspector/inspector-test.js"></script>
-<script src="highlighter-test.js"></script>
-<script>
-
-function test()
-{
- var textModel = new WebInspector.TextEditorModel();
-
- var highlighter = new WebInspector.TextEditorHighlighter(textModel, function() {});
- highlighter.mimeType = "text/javascript";
- highlighter.highlightChunkLimit = Number.MAX_VALUE; // Synchronous.
- highlighter.setHighlightLineLimit(Number.MAX_VALUE);
-
- var src = "/* asdf */ ";
- var comments = 1;
- for (var i = 0; i < 10; ++i) {
- src += src;
- comments *= 2;
- }
- textModel.setText(src);
-
- function checkHighlights()
- {
- var commentsFound = 0;
- for (var lineNumber = 0; lineNumber < textModel.linesCount; ++lineNumber) {
- var highlight = textModel.getAttribute(lineNumber, "highlight");
- for (var i = 0; i < highlight.ranges.length; ++i) {
- var range = highlight.ranges[i];
- if (range.token === "whitespace")
- continue;
- var rangeLength = range.endColumn - range.startColumn + 1;
- if (rangeLength !== 10 || (range.startColumn % 11)) {
- InspectorTest.addResult("ERROR: unexpected highlight result: i=" + range.startColumn + ", length=" + rangeLength);
- break;
- }
- ++commentsFound;
- }
- }
- if (comments !== commentsFound)
- InspectorTest.addResult("ERROR: some of the comments were not highlighted, found: " + commentsFound);
- }
-
- InspectorTest.addResult("Line length: " + src.length + ", number of comments: " + comments);
-
- highlighter.highlight(textModel.linesCount);
- checkHighlights();
-
- // Insert a caret return in the middle of the long line.
- var halfLength = Math.floor(src.length / 2);
- var range = new WebInspector.TextRange(0, halfLength, 0, halfLength);
- var newRange = textModel.editRange(range, "\n");
- highlighter.updateHighlight(newRange.startLine, newRange.endLine + 1);
- checkHighlights();
-
- InspectorTest.addResult("All checks completed.");
- InspectorTest.completeTest();
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-<p>
-This test checks highlighter on a long line.
-</p>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698