| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/prefs/pref_service.h" | 5 #include "base/prefs/pref_service.h" |
| 6 #include "base/prefs/testing_pref_store.h" | 6 #include "base/prefs/testing_pref_store.h" |
| 7 #include "chrome/browser/managed_mode/managed_user_signin_manager_wrapper.h" | 7 #include "chrome/browser/managed_mode/managed_user_signin_manager_wrapper.h" |
| 8 #include "chrome/browser/signin/profile_oauth2_token_service.h" | 8 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
| 9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 10 #include "chrome/browser/signin/signin_manager.h" | 10 #include "chrome/browser/signin/signin_manager.h" |
| 11 #include "chrome/browser/signin/signin_manager_factory.h" | 11 #include "chrome/browser/signin/signin_manager_factory.h" |
| 12 #include "chrome/browser/sync/profile_sync_service_mock.h" | 12 #include "chrome/browser/sync/profile_sync_service_mock.h" |
| 13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 14 #include "chrome/common/url_constants.h" | 14 #include "chrome/common/url_constants.h" |
| 15 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
| 16 | 16 |
| 17 ProfileSyncServiceMock::ProfileSyncServiceMock(Profile* profile) | 17 ProfileSyncServiceMock::ProfileSyncServiceMock(Profile* profile) |
| 18 : ProfileSyncService( | 18 : ProfileSyncService( |
| 19 NULL, | 19 NULL, |
| 20 profile, | 20 profile, |
| 21 new ManagedUserSigninManagerWrapper( | 21 new ManagedUserSigninManagerWrapper( |
| 22 SigninManagerFactory::GetForProfile(profile)), | 22 SigninManagerFactory::GetForProfile(profile)), |
| 23 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 23 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
| 24 ProfileSyncService::MANUAL_START) {} | 24 browser_sync::MANUAL_START) {} |
| 25 | 25 |
| 26 ProfileSyncServiceMock::~ProfileSyncServiceMock() { | 26 ProfileSyncServiceMock::~ProfileSyncServiceMock() { |
| 27 } | 27 } |
| 28 | 28 |
| 29 // static | 29 // static |
| 30 TestingProfile* ProfileSyncServiceMock::MakeSignedInTestingProfile() { | 30 TestingProfile* ProfileSyncServiceMock::MakeSignedInTestingProfile() { |
| 31 TestingProfile* profile = new TestingProfile(); | 31 TestingProfile* profile = new TestingProfile(); |
| 32 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "foo"); | 32 profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, "foo"); |
| 33 return profile; | 33 return profile; |
| 34 } | 34 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 45 std::vector<browser_sync::DeviceInfo*>* device_vector = | 45 std::vector<browser_sync::DeviceInfo*>* device_vector = |
| 46 GetAllSignedInDevicesMock(); | 46 GetAllSignedInDevicesMock(); |
| 47 devices.get() = *device_vector; | 47 devices.get() = *device_vector; |
| 48 return devices.Pass(); | 48 return devices.Pass(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 scoped_ptr<browser_sync::DeviceInfo> | 51 scoped_ptr<browser_sync::DeviceInfo> |
| 52 ProfileSyncServiceMock::GetLocalDeviceInfo() const { | 52 ProfileSyncServiceMock::GetLocalDeviceInfo() const { |
| 53 return scoped_ptr<browser_sync::DeviceInfo>(GetLocalDeviceInfoMock()).Pass(); | 53 return scoped_ptr<browser_sync::DeviceInfo>(GetLocalDeviceInfoMock()).Pass(); |
| 54 } | 54 } |
| OLD | NEW |