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

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

Issue 10827060: 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, 5 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_base_controller_unittest.mm
===================================================================
--- chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_controller_unittest.mm (revision 148477)
+++ chrome/browser/ui/cocoa/bookmarks/bookmark_editor_base_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 "chrome/test/base/test_browser_window.h"
@@ -37,7 +38,7 @@
// b-30
// b-31
// b-4
- 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"));
@@ -96,7 +97,7 @@
};
TEST_F(BookmarkEditorBaseControllerTest, VerifyBookmarkTestModel) {
- BookmarkModel& model(*(profile()->GetBookmarkModel()));
+ BookmarkModel& model(*(BookmarkModelFactory::GetForProfile(profile())));
const BookmarkNode& root(*model.bookmark_bar_node());
EXPECT_EQ(4, root.child_count());
// a
@@ -176,7 +177,7 @@
}
TEST_F(BookmarkEditorBaseControllerTest, CreateTwoFolders) {
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
const BookmarkNode* bar = model->bookmark_bar_node();
// Create 2 folders which are children of the bar.
[controller_ selectTestNodeInBrowser:bar];
@@ -190,7 +191,7 @@
}
TEST_F(BookmarkEditorBaseControllerTest, SelectedFolderDeleted) {
- BookmarkModel& model(*(profile()->GetBookmarkModel()));
+ BookmarkModel& model(*(BookmarkModelFactory::GetForProfile(profile())));
[controller_ selectTestNodeInBrowser:folder_b_3_];
EXPECT_EQ(folder_b_3_, [controller_ selectedNode]);
@@ -202,7 +203,7 @@
}
TEST_F(BookmarkEditorBaseControllerTest, SelectedFoldersParentDeleted) {
- BookmarkModel& model(*(profile()->GetBookmarkModel()));
+ BookmarkModel& model(*(BookmarkModelFactory::GetForProfile(profile())));
const BookmarkNode* root = model.bookmark_bar_node();
[controller_ selectTestNodeInBrowser:folder_b_3_];
EXPECT_EQ(folder_b_3_, [controller_ selectedNode]);
@@ -215,7 +216,7 @@
}
TEST_F(BookmarkEditorBaseControllerTest, FolderAdded) {
- BookmarkModel& model(*(profile()->GetBookmarkModel()));
+ BookmarkModel& model(*(BookmarkModelFactory::GetForProfile(profile())));
const BookmarkNode* root = model.bookmark_bar_node();
// Add a folder node to the model, and verify it can be selected in the tree:
@@ -229,7 +230,7 @@
// Verifies expandeNodes and getExpandedNodes.
TEST_F(BookmarkEditorBaseControllerTest, ExpandedState) {
- BookmarkModel& model(*(profile()->GetBookmarkModel()));
+ BookmarkModel& model(*(BookmarkModelFactory::GetForProfile(profile())));
// Sets up the state we're going to expand.
BookmarkExpandedStateTracker::Nodes nodes;

Powered by Google App Engine
This is Rietveld 408576698