| 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);
|
| +}
|
| +
|
|
|