| 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 23 matching lines...) Expand all Loading... |
| 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) |
| 43 { | 43 { |
| 44 return searchResultA.uiSourceCode.uri().compareTo(searchResultB.uiSo
urceCode.uri()); | 44 return searchResultA.uiSourceCode.url().compareTo(searchResultB.uiSo
urceCode.url()); |
| 45 } | 45 } |
| 46 if (sortByURI) | 46 if (sortByURI) |
| 47 searchResults.sort(comparator); | 47 searchResults.sort(comparator); |
| 48 | 48 |
| 49 for (var i = 0; i < searchResults.length; ++i) { | 49 for (var i = 0; i < searchResults.length; ++i) { |
| 50 var searchResult = searchResults[i]; | 50 var searchResult = searchResults[i]; |
| 51 var uiSourceCode = searchResult.uiSourceCode; | 51 var uiSourceCode = searchResult.uiSourceCode; |
| 52 var searchMatches = searchResult.searchMatches; | 52 var searchMatches = searchResult.searchMatches; |
| 53 | 53 |
| 54 if (!searchMatches.length) | 54 if (!searchMatches.length) |
| 55 continue; | 55 continue; |
| 56 InspectorTest.addResult("Search result #" + (i + 1) + ": uiSourceCod
e.uri = " + uiSourceCode.uri()); | 56 InspectorTest.addResult("Search result #" + (i + 1) + ": uiSourceCod
e.url = " + uiSourceCode.url()); |
| 57 for (var j = 0; j < searchMatches.length; ++j) { | 57 for (var j = 0; j < searchMatches.length; ++j) { |
| 58 var lineNumber = searchMatches[j].lineNumber; | 58 var lineNumber = searchMatches[j].lineNumber; |
| 59 var lineContent = searchMatches[j].lineContent; | 59 var lineContent = searchMatches[j].lineContent; |
| 60 InspectorTest.addResult(" search match #" + (j + 1) + ": lineNu
mber = " + lineNumber + ", lineContent = '" + lineContent + "'"); | 60 InspectorTest.addResult(" search match #" + (j + 1) + ": lineNu
mber = " + lineNumber + ", lineContent = '" + lineContent + "'"); |
| 61 } | 61 } |
| 62 } | 62 } |
| 63 callback(); | 63 callback(); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |