diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-12 01:53:35 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-12 01:53:35 +0000 |
commit | 293b7efa3c31b237005f5872653df94348fff9f8 (patch) | |
tree | 24c104117adcfcfdf2011cd0f78a02ed6b984f4c | |
parent | 30f052ef3f2c8b00644a5ed6a6328aabfaf05c93 (diff) | |
download | chromium_src-293b7efa3c31b237005f5872653df94348fff9f8.zip chromium_src-293b7efa3c31b237005f5872653df94348fff9f8.tar.gz chromium_src-293b7efa3c31b237005f5872653df94348fff9f8.tar.bz2 |
Revert 46996 - Removed redundant TestingProfileSyncService class.
BUG=none
TEST=trybots
Review URL: http://codereview.chromium.org/2008015
TBR=akalin@chromium.org
Review URL: http://codereview.chromium.org/1979011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46997 0039d316-1c4b-4281-b951-d872f2087c98
3 files changed, 34 insertions, 8 deletions
diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index 7ea6a5b..ee5c4c2 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -26,7 +26,6 @@ #include "chrome/browser/sync/profile_sync_test_util.h" #include "chrome/browser/sync/protocol/autofill_specifics.pb.h" #include "chrome/browser/sync/syncable/directory_manager.h" -#include "chrome/browser/sync/test_profile_sync_service.h" #include "chrome/browser/webdata/autofill_change.h" #include "chrome/browser/webdata/autofill_entry.h" #include "chrome/browser/webdata/web_database.h" @@ -96,8 +95,7 @@ class WebDatabaseMock : public WebDatabase { class WebDataServiceFake : public WebDataService { public: - explicit WebDataServiceFake(WebDatabase* web_database) - : web_database_(web_database) {} + WebDataServiceFake(WebDatabase* web_database) : web_database_(web_database) {} virtual bool IsDatabaseLoaded() { return true; } @@ -154,7 +152,7 @@ class ProfileSyncServiceAutofillTest : public testing::Test { void StartSyncService(Task* task) { if (!service_.get()) { service_.reset( - new TestProfileSyncService(&factory_, &profile_, false)); + new TestingProfileSyncService(&factory_, &profile_, false)); service_->AddObserver(&observer_); AutofillDataTypeController* data_type_controller = new AutofillDataTypeController(&factory_, @@ -313,7 +311,7 @@ class ProfileSyncServiceAutofillTest : public testing::Test { ChromeThread db_thread_; scoped_refptr<ThreadNotificationService> notification_service_; - scoped_ptr<TestProfileSyncService> service_; + scoped_ptr<TestingProfileSyncService> service_; ProfileMock profile_; ProfileSyncFactoryMock factory_; ProfileSyncServiceObserverMock observer_; diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index 78ecf31..2872cf6 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -25,7 +25,6 @@ #include "chrome/browser/sync/profile_sync_test_util.h" #include "chrome/browser/sync/protocol/typed_url_specifics.pb.h" #include "chrome/browser/sync/syncable/directory_manager.h" -#include "chrome/browser/sync/test_profile_sync_service.h" #include "chrome/common/notification_service.h" #include "chrome/test/profile_mock.h" #include "chrome/test/sync/engine/test_id_factory.h" @@ -153,7 +152,7 @@ class ProfileSyncServiceTypedUrlTest : public testing::Test { void StartSyncService(Task* task) { if (!service_.get()) { service_.reset( - new TestProfileSyncService(&factory_, &profile_, false)); + new TestingProfileSyncService(&factory_, &profile_, false)); service_->AddObserver(&observer_); TypedUrlDataTypeController* data_type_controller = new TypedUrlDataTypeController(&factory_, @@ -298,7 +297,7 @@ class ProfileSyncServiceTypedUrlTest : public testing::Test { Thread history_thread_; scoped_refptr<ThreadNotificationService> notification_service_; - scoped_ptr<TestProfileSyncService> service_; + scoped_ptr<TestingProfileSyncService> service_; ProfileMock profile_; ProfileSyncFactoryMock factory_; SyncBackendHostMock backend_mock_; diff --git a/chrome/browser/sync/profile_sync_test_util.h b/chrome/browser/sync/profile_sync_test_util.h index 4dbc1cc..eeedc2d 100644 --- a/chrome/browser/sync/profile_sync_test_util.h +++ b/chrome/browser/sync/profile_sync_test_util.h @@ -118,6 +118,35 @@ class ProfileSyncServiceObserverMock : public ProfileSyncServiceObserver { MOCK_METHOD0(OnStateChanged, void()); }; +class TestingProfileSyncService : public ProfileSyncService { + public: + explicit TestingProfileSyncService(ProfileSyncFactory* factory, + Profile* profile, + bool bootstrap_sync_authentication) + : ProfileSyncService(factory, profile, bootstrap_sync_authentication) { + RegisterPreferences(); + SetSyncSetupCompleted(); + } + virtual ~TestingProfileSyncService() { + } + + virtual void InitializeBackend(bool delete_sync_data_folder) { + browser_sync::TestHttpBridgeFactory* factory = + new browser_sync::TestHttpBridgeFactory(); + browser_sync::TestHttpBridgeFactory* factory2 = + new browser_sync::TestHttpBridgeFactory(); + backend()->InitializeForTestMode(L"testuser", factory, factory2, + delete_sync_data_folder, browser_sync::kDefaultNotificationMethod); + } + + private: + // When testing under ChromiumOS, this method must not return an empty + // value value in order for the profile sync service to start. + virtual std::string GetLsidForAuthBootstraping() { + return "foo"; + } +}; + class ThreadNotificationService : public base::RefCountedThreadSafe<ThreadNotificationService> { public: |