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

Unified Diff: chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc

Issue 10825147: Made BookmarkService::GetBookmarks return both urls and title. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync again again Created 8 years, 4 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
Index: chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc
diff --git a/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc b/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc
index fc5283d87ecec1cd39b739aa05d6e2317a381b96..5977d65e7d1a6df9995660569c545e81d9b9169a 100644
--- a/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc
+++ b/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc
@@ -138,10 +138,12 @@ TEST_F(BookmarkModelSQLHandlerTest, UpdateHistoryToBookmark) {
ASSERT_TRUE(handler.Update(row, id_rows));
RunMessageLoopForUI();
// Get all bookmarks and verify there is only one.
- std::vector<GURL> urls;
- bookmark_model_->GetBookmarks(&urls);
- EXPECT_EQ(1u, urls.size());
- EXPECT_EQ(url_row.url(), urls[0]);
+ std::vector<BookmarkService::URLAndTitle> bookmarks;
+ bookmark_model_->GetBookmarks(&bookmarks);
+ ASSERT_EQ(1u, bookmarks.size());
+ EXPECT_EQ(url_row.url(), bookmarks[0].url);
+ EXPECT_EQ(url_row.title(), bookmarks[0].title);
+
// Get the bookmark node.
std::vector<const BookmarkNode*> nodes;
bookmark_model_->GetNodesByURL(row.url(), &nodes);
@@ -155,9 +157,9 @@ TEST_F(BookmarkModelSQLHandlerTest, UpdateHistoryToBookmark) {
row.set_is_bookmark(false);
ASSERT_TRUE(handler.Update(row, id_rows));
RunMessageLoopForUI();
- urls.clear();
- bookmark_model_->GetBookmarks(&urls);
- EXPECT_TRUE(urls.empty());
+ bookmarks.clear();
+ bookmark_model_->GetBookmarks(&bookmarks);
+ EXPECT_TRUE(bookmarks.empty());
// Update with the parent id.
row.set_parent_id(bookmark_model_->other_node()->id());
@@ -165,10 +167,11 @@ TEST_F(BookmarkModelSQLHandlerTest, UpdateHistoryToBookmark) {
ASSERT_TRUE(handler.Update(row, id_rows));
RunMessageLoopForUI();
// Get all bookmarks and verify there is only one.
- urls.clear();
- bookmark_model_->GetBookmarks(&urls);
- EXPECT_EQ(1u, urls.size());
- EXPECT_EQ(url_row.url(), urls[0]);
+ bookmarks.clear();
+ bookmark_model_->GetBookmarks(&bookmarks);
+ ASSERT_EQ(1u, bookmarks.size());
+ EXPECT_EQ(url_row.url(), bookmarks[0].url);
+ EXPECT_EQ(url_row.title(), bookmarks[0].title);
// Get the bookmark node.
nodes.clear();
bookmark_model_->GetNodesByURL(row.url(), &nodes);
@@ -186,10 +189,11 @@ TEST_F(BookmarkModelSQLHandlerTest, UpdateHistoryToBookmark) {
ASSERT_TRUE(handler.Update(update_title, id_rows));
RunMessageLoopForUI();
// Get all bookmarks and verify there is only one.
- urls.clear();
- bookmark_model_->GetBookmarks(&urls);
- EXPECT_EQ(1u, urls.size());
- EXPECT_EQ(url_row.url(), urls[0]);
+ bookmarks.clear();
+ bookmark_model_->GetBookmarks(&bookmarks);
+ ASSERT_EQ(1u, bookmarks.size());
+ EXPECT_EQ(url_row.url(), bookmarks[0].url);
+ EXPECT_EQ(url_row.title(), bookmarks[0].title);
// Get the bookmark node.
nodes.clear();
bookmark_model_->GetNodesByURL(row.url(), &nodes);
« no previous file with comments | « chrome/browser/history/android/android_provider_backend.cc ('k') | chrome/browser/history/history_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698