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

Unified Diff: chrome/browser/views/bookmark_editor_view_unittest.cc

Issue 165031: When we create a new folder in the BookmarkEditor, it is useful to be able to... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/browser/views/bookmark_editor_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/bookmark_editor_view_unittest.cc
===================================================================
--- chrome/browser/views/bookmark_editor_view_unittest.cc (revision 22376)
+++ chrome/browser/views/bookmark_editor_view_unittest.cc (working copy)
@@ -261,3 +261,35 @@
EXPECT_EQ(L"new_a", new_node->GetTitle());
}
+
+// Creates a new group in the tree model and deletes its node from the model.
+// Deletion applies to the tree model and is only used to remove newly created
+// groups.
+TEST_F(BookmarkEditorViewTest, ApplyDeleteNewNode) {
+ BookmarkEditorView editor(profile_.get(), NULL, GetNode("a"),
+ BookmarkEditorView::SHOW_TREE, NULL);
+
+ // Create node "F21" as a child of "F2"
+ BookmarkEditorView::EditorNode* f2 =
+ editor.tree_model_->GetRoot()->GetChild(0)->GetChild(1);
+
+ ASSERT_EQ(0, f2->GetChildCount());
+
+ BookmarkEditorView::EditorNode* f21 = editor.AddNewGroup(f2);
+ f21->SetTitle(L"F21");
+ f21->value = 1000;
+
+ BookmarkEditorView::EditorNode* find_node =
+ editor.FindNodeWithID(editor.tree_model_->GetRoot(), 1000);
+
+ EXPECT_EQ(L"F21", find_node->GetTitle());
+ ASSERT_EQ(f2->GetChildCount(), 1);
+
+ editor.ApplyDelete(reinterpret_cast<TreeModelNode*>(f21));
+
+ find_node = editor.FindNodeWithID(editor.tree_model_->GetRoot(), 1000);
+
+ ASSERT_EQ(0, f2->GetChildCount());
+ ASSERT_EQ(NULL, find_node);
+}
+
« no previous file with comments | « chrome/browser/views/bookmark_editor_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698