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

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: splited into 2 cls Created 8 years, 5 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 89d4cb2a8eef263782899ea71b38571a37508eb0..88953eabb9747d93d8e65e696cbc4dd0a86abed7 100644
--- a/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc
+++ b/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc
@@ -137,10 +137,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::Bookmark> 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);
@@ -154,9 +156,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());
@@ -164,10 +166,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);
@@ -185,10 +188,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);

Powered by Google App Engine
This is Rietveld 408576698