| OLD | NEW |
| 1 // To ensure that no GC-able resources from other tests upset | 1 // To ensure that no GC-able resources from other tests upset |
| 2 // expectations, perform an initial GC. | 2 // expectations, perform an initial GC. |
| 3 if (window.GCController) | 3 if (window.GCController) |
| 4 GCController.collect(); | 4 GCController.collect(); |
| 5 | 5 |
| 6 var initialize_SearchTest = function() { | 6 var initialize_SearchTest = function() { |
| 7 InspectorTest.dumpSearchResults = function(searchResults) | 7 InspectorTest.dumpSearchResults = function(searchResults) |
| 8 { | 8 { |
| 9 function comparator(a, b) | 9 function comparator(a, b) |
| 10 { | 10 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 { | 22 { |
| 23 InspectorTest.addResult("Search matches: "); | 23 InspectorTest.addResult("Search matches: "); |
| 24 for (var i = 0; i < searchMatches.length; i++) | 24 for (var i = 0; i < searchMatches.length; i++) |
| 25 InspectorTest.addResult("lineNumber: " + searchMatches[i].lineNumber + "
, line: '" + searchMatches[i].lineContent + "'"); | 25 InspectorTest.addResult("lineNumber: " + searchMatches[i].lineNumber + "
, line: '" + searchMatches[i].lineContent + "'"); |
| 26 InspectorTest.addResult(""); | 26 InspectorTest.addResult(""); |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 InspectorTest.runSearchAndDumpResults = function(scope, searchConfig, sortByURI,
callback) | 29 InspectorTest.runSearchAndDumpResults = function(scope, searchConfig, sortByURI,
callback) |
| 30 { | 30 { |
| 31 var searchResults = []; | 31 var searchResults = []; |
| 32 var progress = new WebInspector.Progress(); | 32 var progress = new Common.Progress(); |
| 33 scope.performSearch(searchConfig, progress, searchResultCallback, searchFini
shedCallback); | 33 scope.performSearch(searchConfig, progress, searchResultCallback, searchFini
shedCallback); |
| 34 | 34 |
| 35 function searchResultCallback(searchResult) | 35 function searchResultCallback(searchResult) |
| 36 { | 36 { |
| 37 searchResults.push(searchResult); | 37 searchResults.push(searchResult); |
| 38 } | 38 } |
| 39 | 39 |
| 40 function searchFinishedCallback() | 40 function searchFinishedCallback() |
| 41 { | 41 { |
| 42 function comparator(searchResultA, searchResultB) | 42 function comparator(searchResultA, searchResultB) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 if (replaceAll) | 74 if (replaceAll) |
| 75 modifiers.push("replaceAll"); | 75 modifiers.push("replaceAll"); |
| 76 var modifiersString = modifiers.length ? " (" + modifiers.join(", ") + ")"
: ""; | 76 var modifiersString = modifiers.length ? " (" + modifiers.join(", ") + ")"
: ""; |
| 77 | 77 |
| 78 InspectorTest.addResult("Running replace test for /" + searchConfig.query +
"/" + replacement + "/ " + modifiersString + ":"); | 78 InspectorTest.addResult("Running replace test for /" + searchConfig.query +
"/" + replacement + "/ " + modifiersString + ":"); |
| 79 | 79 |
| 80 editor = sourceFrame._textEditor; | 80 editor = sourceFrame._textEditor; |
| 81 var oldLines = []; | 81 var oldLines = []; |
| 82 for (var i = 0; i < editor.linesCount; ++i) | 82 for (var i = 0; i < editor.linesCount; ++i) |
| 83 oldLines.push(editor.line(i)); | 83 oldLines.push(editor.line(i)); |
| 84 var searchableView = WebInspector.panels.sources.sourcesView().searchableVie
w(); | 84 var searchableView = UI.panels.sources.sourcesView().searchableView(); |
| 85 searchableView.showSearchField(); | 85 searchableView.showSearchField(); |
| 86 | 86 |
| 87 searchableView._caseSensitiveButton.setToggled(searchConfig.caseSensitive); | 87 searchableView._caseSensitiveButton.setToggled(searchConfig.caseSensitive); |
| 88 searchableView._regexButton.setToggled(searchConfig.isRegex); | 88 searchableView._regexButton.setToggled(searchConfig.isRegex); |
| 89 searchableView._searchInputElement.value = searchConfig.query; | 89 searchableView._searchInputElement.value = searchConfig.query; |
| 90 searchableView._replaceCheckboxElement.checked = true; | 90 searchableView._replaceCheckboxElement.checked = true; |
| 91 searchableView._updateSecondRowVisibility(); | 91 searchableView._updateSecondRowVisibility(); |
| 92 searchableView._replaceInputElement.value = replacement; | 92 searchableView._replaceInputElement.value = replacement; |
| 93 searchableView._performSearch(true, true); | 93 searchableView._performSearch(true, true); |
| 94 if (replaceAll) | 94 if (replaceAll) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 114 ++postfixLength; | 114 ++postfixLength; |
| 115 var prefix = oldLine.substring(0, prefixLength); | 115 var prefix = oldLine.substring(0, prefixLength); |
| 116 var removed = oldLine.substring(prefixLength, oldLine.length - postfixLe
ngth); | 116 var removed = oldLine.substring(prefixLength, oldLine.length - postfixLe
ngth); |
| 117 var added = newLine.substring(prefixLength, newLine.length - postfixLeng
th); | 117 var added = newLine.substring(prefixLength, newLine.length - postfixLeng
th); |
| 118 var postfix = oldLine.substring(oldLine.length - postfixLength); | 118 var postfix = oldLine.substring(oldLine.length - postfixLength); |
| 119 InspectorTest.addResult(" - " + prefix + "#" + removed + "#" + added +
"#" + postfix); | 119 InspectorTest.addResult(" - " + prefix + "#" + removed + "#" + added +
"#" + postfix); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 }; | 123 }; |
| OLD | NEW |