| Index: chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
|
| diff --git a/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc b/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
|
| index b5edd314953739110e7916cda5a4b5ae024bd3ca..efe987490a3a306da3fdd4552a032ee86d0ba696 100644
|
| --- a/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
|
| +++ b/chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc
|
| @@ -4,6 +4,9 @@
|
|
|
| #include "chrome/browser/ui/sync/one_click_signin_sync_observer.h"
|
|
|
| +#include <string>
|
| +#include <utility>
|
| +
|
| #include "base/bind.h"
|
| #include "base/callback.h"
|
| #include "base/macros.h"
|
| @@ -12,6 +15,7 @@
|
| #include "chrome/browser/signin/signin_manager_factory.h"
|
| #include "chrome/browser/signin/signin_promo.h"
|
| #include "chrome/browser/sync/profile_sync_service_factory.h"
|
| +#include "chrome/browser/sync/profile_sync_test_util.h"
|
| #include "chrome/browser/sync/test_profile_sync_service.h"
|
| #include "chrome/test/base/chrome_render_view_host_test_harness.h"
|
| #include "chrome/test/base/testing_profile.h"
|
| @@ -50,8 +54,9 @@ class OneClickTestProfileSyncService : public TestProfileSyncService {
|
| // Helper routine to be used in conjunction with
|
| // BrowserContextKeyedServiceFactory::SetTestingFactory().
|
| static scoped_ptr<KeyedService> Build(content::BrowserContext* profile) {
|
| - return make_scoped_ptr(
|
| - new OneClickTestProfileSyncService(static_cast<Profile*>(profile)));
|
| + return make_scoped_ptr(new OneClickTestProfileSyncService(
|
| + CreateProfileSyncServiceParamsForTest(
|
| + Profile::FromBrowserContext(profile))));
|
| }
|
|
|
| bool IsFirstSetupInProgress() const override {
|
| @@ -69,17 +74,16 @@ class OneClickTestProfileSyncService : public TestProfileSyncService {
|
| }
|
|
|
| private:
|
| - explicit OneClickTestProfileSyncService(Profile* profile)
|
| - : TestProfileSyncService(
|
| - profile,
|
| - SigninManagerFactory::GetForProfile(profile),
|
| - ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
|
| - browser_sync::MANUAL_START),
|
| + explicit OneClickTestProfileSyncService(
|
| + ProfileSyncService::InitParams init_params)
|
| + : TestProfileSyncService(std::move(init_params)),
|
| first_setup_in_progress_(false),
|
| sync_active_(false) {}
|
|
|
| bool first_setup_in_progress_;
|
| bool sync_active_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(OneClickTestProfileSyncService);
|
| };
|
|
|
| class TestOneClickSigninSyncObserver : public OneClickSigninSyncObserver {
|
| @@ -158,6 +162,8 @@ class OneClickSigninSyncObserverTest : public ChromeRenderViewHostTestHarness {
|
|
|
| TestOneClickSigninSyncObserver* sync_observer_;
|
| bool sync_observer_destroyed_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(OneClickSigninSyncObserverTest);
|
| };
|
|
|
| // Verify that if no Sync service is present, e.g. because Sync is disabled, the
|
|
|