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

Unified Diff: components/bookmarks/browser/bookmark_index_unittest.cc

Issue 2537223008: Add TitledUrlIndex for indexing arbitrary title/URL pairs (Closed)
Patch Set: const Created 4 years 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 | « components/bookmarks/browser/bookmark_index.cc ('k') | components/bookmarks/browser/bookmark_match.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/bookmarks/browser/bookmark_index_unittest.cc
diff --git a/components/bookmarks/browser/bookmark_index_unittest.cc b/components/bookmarks/browser/bookmark_index_unittest.cc
index b476d86baedb76d771ba2e1c01cb71c225fd0e55..50be374a111e861c3c77866bd15906286101980f 100644
--- a/components/bookmarks/browser/bookmark_index_unittest.cc
+++ b/components/bookmarks/browser/bookmark_index_unittest.cc
@@ -100,7 +100,8 @@ class BookmarkIndexTest : public testing::Test {
for (size_t i = 0; i < expected_titles.size(); ++i) {
bool found = false;
for (size_t j = 0; j < matches.size(); ++j) {
- if (ASCIIToUTF16(expected_titles[i]) == matches[j].node->GetTitle()) {
+ const base::string16& title = matches[j].node->GetTitledUrlNodeTitle();
+ if (ASCIIToUTF16(expected_titles[i]) == title) {
matches.erase(matches.begin() + j);
found = true;
break;
@@ -532,7 +533,7 @@ TEST_F(BookmarkIndexTest, GetResultsSortedByTypedCount) {
base::MakeUnique<BookmarkClientMock>(typed_count_map));
for (size_t i = 0; i < arraysize(data); ++i)
- // Populate the BookmarkIndex.
+ // Populate the bookmark index.
model->AddURL(
model->other_node(), i, UTF8ToUTF16(data[i].title), data[i].url);
@@ -546,18 +547,18 @@ TEST_F(BookmarkIndexTest, GetResultsSortedByTypedCount) {
// 3. Google Docs (docs.google.com) 50
// 4. Google Maps (maps.google.com) 40
ASSERT_EQ(4U, matches.size());
- EXPECT_EQ(data[0].url, matches[0].node->url());
- EXPECT_EQ(data[3].url, matches[1].node->url());
- EXPECT_EQ(data[2].url, matches[2].node->url());
- EXPECT_EQ(data[1].url, matches[3].node->url());
+ EXPECT_EQ(data[0].url, matches[0].node->GetTitledUrlNodeUrl());
+ EXPECT_EQ(data[3].url, matches[1].node->GetTitledUrlNodeUrl());
+ EXPECT_EQ(data[2].url, matches[2].node->GetTitledUrlNodeUrl());
+ EXPECT_EQ(data[1].url, matches[3].node->GetTitledUrlNodeUrl());
matches.clear();
// Select top two matches.
model->GetBookmarksMatching(ASCIIToUTF16("google"), 2, &matches);
ASSERT_EQ(2U, matches.size());
- EXPECT_EQ(data[0].url, matches[0].node->url());
- EXPECT_EQ(data[3].url, matches[1].node->url());
+ EXPECT_EQ(data[0].url, matches[0].node->GetTitledUrlNodeUrl());
+ EXPECT_EQ(data[3].url, matches[1].node->GetTitledUrlNodeUrl());
}
} // namespace
« no previous file with comments | « components/bookmarks/browser/bookmark_index.cc ('k') | components/bookmarks/browser/bookmark_match.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698