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

Unified Diff: components/undo/bookmark_undo_service_test.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
Index: components/undo/bookmark_undo_service_test.cc
diff --git a/components/undo/bookmark_undo_service_test.cc b/components/undo/bookmark_undo_service_test.cc
index e97988a67a3031eca8a9da732cab8adf9a27430b..2e989fda25e2dec2febfbf8b2360d44cc9d80e98 100644
--- a/components/undo/bookmark_undo_service_test.cc
+++ b/components/undo/bookmark_undo_service_test.cc
@@ -90,7 +90,7 @@ TEST_F(BookmarkUndoServiceTest, UndoBookmarkRemove) {
const BookmarkNode* parent = model->other_node();
model->AddURL(parent, 0, ASCIIToUTF16("foo"), GURL("http://www.bar.com"));
- model->Remove(parent, 0);
+ model->Remove(parent->GetChild(0));
EXPECT_EQ(2U, undo_service->undo_manager()->undo_count());
EXPECT_EQ(0U, undo_service->undo_manager()->redo_count());
@@ -232,7 +232,7 @@ TEST_F(BookmarkUndoServiceTest, UndoBookmarkRenameDelete) {
ASCIIToUTF16("folder"));
model->AddURL(f1, 0, ASCIIToUTF16("foo"), GURL("http://www.foo.com"));
model->SetTitle(f1, ASCIIToUTF16("Renamed"));
- model->Remove(model->other_node(), 0);
+ model->Remove(model->other_node()->GetChild(0));
// Undo the folder removal and ensure the folder and bookmark were restored.
undo_service->undo_manager()->Undo();
@@ -366,7 +366,7 @@ TEST_F(BookmarkUndoServiceTest, UndoRemoveFolderWithBookmarks) {
new_folder = model->AddFolder(parent, 0, ASCIIToUTF16("folder"));
model->AddURL(new_folder, 0, ASCIIToUTF16("bar"), GURL("http://www.bar.com"));
- model->Remove(parent, 0);
+ model->Remove(parent->GetChild(0));
// Test that the undo restores the bookmark and folder.
undo_service->undo_manager()->Undo();
« components/bookmarks/browser/bookmark_model.cc ('K') | « components/undo/bookmark_undo_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698