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

Unified Diff: chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc

Issue 1198963014: Change ownership of BookmarkClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_managed_and_supervised_nodes
Patch Set: Rebase Created 5 years, 6 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/history/DEPS ('k') | chrome/browser/sync/profile_sync_service_bookmark_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
index 9f6c3b0f2aed0705be9aef07246d4576f4b8b5b7..c97b7ebaacf771e2868b015ce68eacb3b172a57e 100644
--- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
@@ -12,7 +12,6 @@
#include "base/run_loop.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/chrome_bookmark_client.h"
-#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/profiles/profile.h"
@@ -58,20 +57,11 @@ class HistoryMock : public history::HistoryService {
~HistoryMock() override {}
};
-scoped_ptr<KeyedService> BuildChromeBookmarkClient(
- content::BrowserContext* context) {
- return make_scoped_ptr(
- new ChromeBookmarkClient(static_cast<Profile*>(context)));
-}
-
scoped_ptr<KeyedService> BuildBookmarkModelWithoutLoading(
content::BrowserContext* context) {
Profile* profile = static_cast<Profile*>(context);
- ChromeBookmarkClient* bookmark_client =
- ChromeBookmarkClientFactory::GetForProfile(profile);
- scoped_ptr<BookmarkModel> bookmark_model(new BookmarkModel(bookmark_client));
- bookmark_client->Init(bookmark_model.get());
- return bookmark_model.Pass();
+ return make_scoped_ptr(
+ new BookmarkModel(make_scoped_ptr(new ChromeBookmarkClient(profile))));
}
scoped_ptr<KeyedService> BuildBookmarkModel(content::BrowserContext* context) {
@@ -120,8 +110,6 @@ class SyncBookmarkDataTypeControllerTest : public testing::Test {
};
void CreateBookmarkModel(BookmarkLoadPolicy bookmark_load_policy) {
- ChromeBookmarkClientFactory::GetInstance()->SetTestingFactory(
- &profile_, BuildChromeBookmarkClient);
if (bookmark_load_policy == LOAD_MODEL) {
bookmark_model_ = static_cast<BookmarkModel*>(
BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse(
« no previous file with comments | « chrome/browser/history/DEPS ('k') | chrome/browser/sync/profile_sync_service_bookmark_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698