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

Unified Diff: chrome/browser/history/in_memory_url_index_types_unittest.cc

Issue 255423002: Omnibox: Highlight Matches in URLs Properly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix OffsetsFromTermMatches test Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/history/in_memory_url_index_types.cc ('k') | chrome/browser/history/scored_history_match.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/in_memory_url_index_types_unittest.cc
diff --git a/chrome/browser/history/in_memory_url_index_types_unittest.cc b/chrome/browser/history/in_memory_url_index_types_unittest.cc
index 82f995f060fbfe16c3e2f3020935aa842341431e..f45481c023853f338a3df4c2d1b2a7b0868a9ce9 100644
--- a/chrome/browser/history/in_memory_url_index_types_unittest.cc
+++ b/chrome/browser/history/in_memory_url_index_types_unittest.cc
@@ -132,13 +132,13 @@ TEST_F(InMemoryURLIndexTypesTest, OffsetsAndTermMatches) {
matches_a.push_back(history::TermMatch(3, 10, 1));
matches_a.push_back(history::TermMatch(4, 14, 5));
std::vector<size_t> offsets = OffsetsFromTermMatches(matches_a);
- const size_t expected_offsets_a[] = {1, 4, 9, 10, 14};
+ const size_t expected_offsets_a[] = {1, 3, 4, 7, 9, 10, 10, 11, 14, 19};
ASSERT_EQ(offsets.size(), arraysize(expected_offsets_a));
for (size_t i = 0; i < offsets.size(); ++i)
EXPECT_EQ(expected_offsets_a[i], offsets[i]);
// Test ReplaceOffsetsInTermMatches
- offsets[2] = base::string16::npos;
+ offsets[4] = base::string16::npos; // offset of third term
history::TermMatches matches_b =
ReplaceOffsetsInTermMatches(matches_a, offsets);
const size_t expected_offsets_b[] = {1, 4, 10, 14};
« no previous file with comments | « chrome/browser/history/in_memory_url_index_types.cc ('k') | chrome/browser/history/scored_history_match.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698