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

Unified Diff: chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc

Issue 9232011: sync: Make ProfileSyncService a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 11 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/sync/profile_sync_components_factory_impl_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
index 1ed8c5f267d2970ed4f4fbb5f5a0b7eb854479b2..ad448531003fd211705154c630856c062c6f3b01 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,9 +28,6 @@ class ProfileSyncComponentsFactoryImplTest : public testing::Test {
profile_.reset(new TestingProfile());
FilePath program_path(FILE_PATH_LITERAL("chrome.exe"));
command_line_.reset(new CommandLine(program_path));
- profile_sync_service_factory_.reset(
- new ProfileSyncComponentsFactoryImpl(profile_.get(),
- command_line_.get()));
}
// Returns the collection of default datatypes.
@@ -79,8 +76,13 @@ class ProfileSyncComponentsFactoryImplTest : public testing::Test {
syncable::ModelType type) {
command_line_->AppendSwitch(cmd_switch);
scoped_ptr<ProfileSyncService> pss(
- profile_sync_service_factory_->CreateProfileSyncService());
- profile_sync_service_factory_->RegisterDataTypes(pss.get());
+ new ProfileSyncService(
+ new ProfileSyncComponentsFactoryImpl(profile_.get(),
+ command_line_.get()),
+ profile_.get(),
+ NULL,
+ ProfileSyncService::MANUAL_START));
+ pss->factory()->RegisterDataTypes(pss.get());
DataTypeController::StateMap controller_states;
pss->GetDataTypeControllerStates(&controller_states);
EXPECT_EQ(DefaultDatatypesCount() - 1, controller_states.size());
@@ -91,13 +93,17 @@ class ProfileSyncComponentsFactoryImplTest : public testing::Test {
content::TestBrowserThread ui_thread_;
scoped_ptr<Profile> profile_;
scoped_ptr<CommandLine> command_line_;
- scoped_ptr<ProfileSyncComponentsFactoryImpl> profile_sync_service_factory_;
};
TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDefault) {
scoped_ptr<ProfileSyncService> pss(
- profile_sync_service_factory_->CreateProfileSyncService());
- profile_sync_service_factory_->RegisterDataTypes(pss.get());
+ new ProfileSyncService(
+ new ProfileSyncComponentsFactoryImpl(profile_.get(),
+ command_line_.get()),
+ profile_.get(),
+ NULL,
+ ProfileSyncService::MANUAL_START));
+ pss->factory()->RegisterDataTypes(pss.get());
DataTypeController::StateMap controller_states;
pss->GetDataTypeControllerStates(&controller_states);
EXPECT_EQ(DefaultDatatypesCount(), controller_states.size());

Powered by Google App Engine
This is Rietveld 408576698