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

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

Issue 2269183003: DevTools: Merge CodeMirrorTextEditor's copyRange into text (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/editor/editor-test.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 WebInspector.TextRange(range.startLine, 0, ran ge.startLine, range.startColumn); 25 var prefixRange = new WebInspector.TextRange(range.startLine, 0, ran ge.startLine, range.startColumn);
26 var postfixRange = new WebInspector.TextRange(range.endLine, range.e ndColumn, range.endLine, sourceFrame._textEditor.line(range.endLine).length); 26 var postfixRange = new WebInspector.TextRange(range.endLine, range.e ndColumn, range.endLine, sourceFrame._textEditor.line(range.endLine).length);
27 var prefix = sourceFrame._textEditor.copyRange(prefixRange); 27 var prefix = sourceFrame._textEditor.text(prefixRange);
28 var result = sourceFrame._textEditor.copyRange(range); 28 var result = sourceFrame._textEditor.text(range);
29 var postfix = sourceFrame._textEditor.copyRange(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 WebInspector.SourcesPanel.show(); 34 WebInspector.SourcesPanel.show();
35 InspectorTest.showScriptSource("search.js", didShowScriptSource); 35 InspectorTest.showScriptSource("search.js", didShowScriptSource);
36 36
37 function didShowScriptSource(sourceFrame) 37 function didShowScriptSource(sourceFrame)
38 { 38 {
39 InspectorTest.runTestSuite([ 39 InspectorTest.runTestSuite([
(...skipping 38 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/editor/editor-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698