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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/search/source-frame-search.html

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 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../inspector-test.js"></script> 3 <script src="../inspector-test.js"></script>
4 <script src="../debugger-test.js"></script> 4 <script src="../debugger-test.js"></script>
5 <script src="../sources-test.js"></script> 5 <script src="../sources-test.js"></script>
6 <script src="resources/search.js"></script> 6 <script src="resources/search.js"></script>
7 <script> 7 <script>
8 function test() 8 function test()
9 { 9 {
10 function dumpSearchResultsForConfig(sourceFrame, searchConfig) 10 function dumpSearchResultsForConfig(sourceFrame, searchConfig)
11 { 11 {
12 var modifiers = []; 12 var modifiers = [];
13 if (searchConfig.isRegex) 13 if (searchConfig.isRegex)
14 modifiers.push("regex"); 14 modifiers.push("regex");
15 if (searchConfig.caseSensitive) 15 if (searchConfig.caseSensitive)
16 modifiers.push("caseSensitive"); 16 modifiers.push("caseSensitive");
17 var modifiersString = modifiers.length ? " (" + modifiers.join(", ") + ")" : ""; 17 var modifiersString = modifiers.length ? " (" + modifiers.join(", ") + ")" : "";
18 18
19 InspectorTest.addResult("Running search test for query = " + searchConfi g.query + modifiersString + ":"); 19 InspectorTest.addResult("Running search test for query = " + searchConfi g.query + modifiersString + ":");
20 sourceFrame.performSearch(searchConfig, false, false); 20 sourceFrame.performSearch(searchConfig, false, false);
21 21
22 var searchResults = sourceFrame._searchResults; 22 var searchResults = sourceFrame._searchResults;
23 for (var i = 0; i < searchResults.length; ++i) { 23 for (var i = 0; i < searchResults.length; ++i) {
24 var range = searchResults[i]; 24 var range = searchResults[i];
25 var prefixRange = new Common.TextRange(range.startLine, 0, range.sta rtLine, range.startColumn); 25 var prefixRange = new TextUtils.TextRange(range.startLine, 0, range. startLine, range.startColumn);
26 var postfixRange = new Common.TextRange(range.endLine, range.endColu mn, range.endLine, sourceFrame._textEditor.line(range.endLine).length); 26 var postfixRange = new TextUtils.TextRange(range.endLine, range.endC olumn, range.endLine, sourceFrame._textEditor.line(range.endLine).length);
27 var prefix = sourceFrame._textEditor.text(prefixRange); 27 var prefix = sourceFrame._textEditor.text(prefixRange);
28 var result = sourceFrame._textEditor.text(range); 28 var result = sourceFrame._textEditor.text(range);
29 var postfix = sourceFrame._textEditor.text(postfixRange); 29 var postfix = sourceFrame._textEditor.text(postfixRange);
30 InspectorTest.addResult(" - " + prefix + "<" + result + ">" + postf ix); 30 InspectorTest.addResult(" - " + prefix + "<" + result + ">" + postf ix);
31 } 31 }
32 } 32 }
33 33
34 UI.viewManager.showView("sources"); 34 UI.viewManager.showView("sources");
35 InspectorTest.showScriptSource("search.js", didShowScriptSource); 35 InspectorTest.showScriptSource("search.js", didShowScriptSource);
36 36
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 ]); 79 ]);
80 } 80 }
81 }; 81 };
82 </script> 82 </script>
83 </head> 83 </head>
84 <body onload="runTest()"> 84 <body onload="runTest()">
85 <p>Tests different types of search in SourceFrame</p> 85 <p>Tests different types of search in SourceFrame</p>
86 </body> 86 </body>
87 </html> 87 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698