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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/live-edit-test.js

Issue 2769843003: DevTools: split text_utils out of common module (Closed)
Patch Set: rebaseline Created 3 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 unified diff | Download patch
OLDNEW
1 var initialize_LiveEditTest = function() { 1 var initialize_LiveEditTest = function() {
2 2
3 InspectorTest.replaceInSource = function(sourceFrame, string, replacement) 3 InspectorTest.replaceInSource = function(sourceFrame, string, replacement)
4 { 4 {
5 sourceFrame._textEditor.setReadOnly(false); 5 sourceFrame._textEditor.setReadOnly(false);
6 for (var i = 0; i < sourceFrame._textEditor.linesCount; ++i) { 6 for (var i = 0; i < sourceFrame._textEditor.linesCount; ++i) {
7 var line = sourceFrame._textEditor.line(i); 7 var line = sourceFrame._textEditor.line(i);
8 var column = line.indexOf(string); 8 var column = line.indexOf(string);
9 if (column === -1) 9 if (column === -1)
10 continue; 10 continue;
11 range = new Common.TextRange(i, column, i, column + string.length); 11 range = new TextUtils.TextRange(i, column, i, column + string.length);
12 var newRange = sourceFrame._textEditor.editRange(range, replacement); 12 var newRange = sourceFrame._textEditor.editRange(range, replacement);
13 break; 13 break;
14 } 14 }
15 } 15 }
16 16
17 InspectorTest.commitSource = function(sourceFrame) 17 InspectorTest.commitSource = function(sourceFrame)
18 { 18 {
19 sourceFrame.commitEditing(); 19 sourceFrame.commitEditing();
20 } 20 }
21 21
22 InspectorTest.undoSourceEditing = function(sourceFrame) 22 InspectorTest.undoSourceEditing = function(sourceFrame)
23 { 23 {
24 sourceFrame._textEditor.undo(); 24 sourceFrame._textEditor.undo();
25 } 25 }
26 26
27 }; 27 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698