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

Unified Diff: third_party/WebKit/LayoutTests/inspector/sass/sass-test.js

Issue 1809533003: DevTools: remove illusionary caching from String.prototype.lineEndings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: String.prototype.lineEndings -> String.prototype.computeLineEndings Created 4 years, 9 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: third_party/WebKit/LayoutTests/inspector/sass/sass-test.js
diff --git a/third_party/WebKit/LayoutTests/inspector/sass/sass-test.js b/third_party/WebKit/LayoutTests/inspector/sass/sass-test.js
index 317118aa3229909f204ca11176e88d94d0a3d9c5..27c46aa0d4807d61b5ce913136f97c6eb2b707ca 100644
--- a/third_party/WebKit/LayoutTests/inspector/sass/sass-test.js
+++ b/third_party/WebKit/LayoutTests/inspector/sass/sass-test.js
@@ -168,7 +168,7 @@ InspectorTest.validateASTRanges = function(ast)
function validate(textNode)
{
- if (textNode.range.extract(textNode.document.text) !== textNode.text)
+ if (textNode.document.text.extract(textNode.range) !== textNode.text)
invalidNodes.push(textNode);
}
}
@@ -234,7 +234,7 @@ InspectorTest.runCSSEditTests = function(header, tests)
}
var test = tests.shift();
logTestName(test.name);
- var text = astSourceMap.cssAST().document.text;
+ var text = astSourceMap.cssAST().document.text.value();
var edits = test(text);
logSourceEdits(text, edits);
var ranges = edits.map(edit => edit.oldRange);
@@ -262,7 +262,7 @@ InspectorTest.runCSSEditTests = function(header, tests)
{
customTitle = customTitle || ast.document.url.split("/").pop();
InspectorTest.addResult("===== " + customTitle + " =====");
- var text = ast.document.text.replace(/ /g, ".");
+ var text = ast.document.text.value().replace(/ /g, ".");
var lines = text.split("\n");
if (!avoidIndent)
lines = indent(lines);
@@ -287,7 +287,7 @@ InspectorTest.runCSSEditTests = function(header, tests)
var edit = edits[i];
var range = edit.oldRange;
var line = String.sprintf("{%d, %d, %d, %d}", range.startLine, range.startColumn, range.endLine, range.endColumn);
- line += String.sprintf(" '%s' => '%s'", range.extract(text), edit.newText);
+ line += String.sprintf(" '%s' => '%s'", (new WebInspector.Text(text)).extract(range), edit.newText);
lines.push(line);
}
lines = indent(lines);
@@ -307,7 +307,7 @@ InspectorTest.createEdit = function(source, pattern, newText, matchNumber)
if (!match)
return null;
var sourceRange = new WebInspector.SourceRange(match.index, match[0].length);
- var textRange = sourceRange.toTextRange(source);
+ var textRange = sourceRange.toTextRange(new WebInspector.Text(source));
return new WebInspector.SourceEdit("", textRange, newText);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector/sass/editing-test-suite.js ('k') | third_party/WebKit/Source/devtools/devtools.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698