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

Unified Diff: components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc

Issue 1105413002: Avoid conversion of index to BookmarkNode pointer unnacessarily. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 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 | « components/bookmarks/managed/managed_bookmarks_tracker.cc ('k') | components/undo/bookmark_undo_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
diff --git a/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc b/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
index 4b53abdf35c0cc647f0a0947bed9edcb3c4afe7f..c7c29f9c79c881109ddfbedc3f7c386f19cf30de 100644
--- a/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
+++ b/components/enhanced_bookmarks/enhanced_bookmark_model_unittest.cc
@@ -595,12 +595,11 @@ TEST_F(EnhancedBookmarkModelTest, ObserverNodeRemovedEvent) {
const BookmarkNode* folder = AddFolder();
EXPECT_EQ(0, removed_calls_);
- bookmark_model_->Remove(node->parent(), node->parent()->GetIndexOf(node));
+ bookmark_model_->Remove(node);
EXPECT_EQ(1, removed_calls_);
EXPECT_EQ(node, last_removed_);
- bookmark_model_->Remove(folder->parent(),
- folder->parent()->GetIndexOf(folder));
+ bookmark_model_->Remove(folder);
EXPECT_EQ(2, removed_calls_);
EXPECT_EQ(folder, last_removed_);
}
@@ -675,7 +674,7 @@ TEST_F(EnhancedBookmarkModelTest, NodeRemovedWhileResetDuplicationScheduled) {
const BookmarkNode* node2 = AddBookmark();
bookmark_model_->SetNodeMetaInfo(node1, "stars.id", "c_1");
bookmark_model_->SetNodeMetaInfo(node2, "stars.id", "c_1");
- bookmark_model_->Remove(node1->parent(), node1->parent()->GetIndexOf(node1));
+ bookmark_model_->Remove(node1);
base::RunLoop().RunUntilIdle();
}
@@ -686,8 +685,7 @@ TEST_F(EnhancedBookmarkModelTest,
std::string remote_id = GetId(node);
EXPECT_EQ(node, model_->BookmarkForRemoteId(remote_id));
- const BookmarkNode* gp = parent->parent();
- bookmark_model_->Remove(gp, gp->GetIndexOf(parent));
+ bookmark_model_->Remove(parent);
EXPECT_FALSE(model_->BookmarkForRemoteId(remote_id));
}
« no previous file with comments | « components/bookmarks/managed/managed_bookmarks_tracker.cc ('k') | components/undo/bookmark_undo_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698