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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm

Issue 10834161: Removing instances of profile_->GetBookmarkModel() as part of converting BookmarkModel to a PKS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm
===================================================================
--- chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm (revision 149630)
+++ chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller_unittest.mm (working copy)
@@ -8,6 +8,7 @@
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.h"
#include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -26,7 +27,7 @@
CocoaProfileTest::SetUp();
ASSERT_TRUE(profile());
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
default_parent_ = model->bookmark_bar_node();
default_name_ = "http://www.zim-bop-a-dee.com/";
default_title_ = ASCIIToUTF16("ooh title");
@@ -89,7 +90,7 @@
TEST_F(BookmarkEditorControllerTest, NodeDeleted) {
// Delete the bookmark being edited and verify the sheet cancels itself:
ASSERT_TRUE([test_window() attachedSheet]);
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
model->Remove(default_parent_, 0);
ASSERT_FALSE([test_window() attachedSheet]);
}
@@ -140,7 +141,7 @@
CocoaProfileTest::SetUp();
ASSERT_TRUE(profile());
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
const BookmarkNode* parent = model->bookmark_bar_node();
controller_ = [[BookmarkEditorController alloc]
initWithParentWindow:test_window()
@@ -177,7 +178,7 @@
CocoaProfileTest::SetUp();
ASSERT_TRUE(profile());
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
const BookmarkNode* parent = model->bookmark_bar_node();
default_title_ = ASCIIToUTF16("wooh title");
url_name_ = "http://www.zoom-baby-doo-da.com/";
@@ -233,7 +234,7 @@
// bb-4
// b-1
// b-2
- BookmarkModel& model(*(profile()->GetBookmarkModel()));
+ BookmarkModel& model(*(BookmarkModelFactory::GetForProfile(profile())));
const BookmarkNode* root = model.bookmark_bar_node();
folder_a_ = model.AddFolder(root, 0, ASCIIToUTF16("a"));
model.AddURL(folder_a_, 0, ASCIIToUTF16("a-0"), GURL("http://a-0.com"));
@@ -299,7 +300,7 @@
// bookmark_bb_3_ so that it points to the new node for testing.
void UpdateBB3() {
std::vector<const BookmarkNode*> nodes;
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
model->GetNodesByURL(bb3_url_1_, &nodes);
if (nodes.empty())
model->GetNodesByURL(bb3_url_2_, &nodes);
@@ -310,7 +311,7 @@
};
TEST_F(BookmarkEditorControllerTreeTest, VerifyBookmarkTestModel) {
- BookmarkModel& model(*(profile()->GetBookmarkModel()));
+ BookmarkModel& model(*(BookmarkModelFactory::GetForProfile(profile())));
model.root_node();
const BookmarkNode& root(*model.bookmark_bar_node());
EXPECT_EQ(4, root.child_count());

Powered by Google App Engine
This is Rietveld 408576698