| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/invalidation/fake_invalidation_service.h" | 12 #include "chrome/browser/invalidation/fake_invalidation_service.h" |
| 13 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" | 13 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" |
| 14 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" | 14 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" |
| 15 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" | 15 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" |
| 16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 16 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 17 #include "chrome/browser/signin/signin_manager_factory.h" | 17 #include "chrome/browser/signin/signin_manager_factory.h" |
| 18 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" | 18 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" |
| 19 #include "chrome/browser/sync/managed_user_signin_manager_wrapper.h" | |
| 20 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | 19 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
| 20 #include "chrome/browser/sync/supervised_user_signin_manager_wrapper.h" |
| 21 #include "chrome/common/chrome_switches.h" | 21 #include "chrome/common/chrome_switches.h" |
| 22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 23 #include "chrome/test/base/testing_browser_process.h" | 23 #include "chrome/test/base/testing_browser_process.h" |
| 24 #include "chrome/test/base/testing_pref_service_syncable.h" | 24 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 25 #include "chrome/test/base/testing_profile.h" | 25 #include "chrome/test/base/testing_profile.h" |
| 26 #include "chrome/test/base/testing_profile_manager.h" | 26 #include "chrome/test/base/testing_profile_manager.h" |
| 27 #include "components/invalidation/invalidation_service.h" | 27 #include "components/invalidation/invalidation_service.h" |
| 28 #include "components/invalidation/profile_invalidation_provider.h" | 28 #include "components/invalidation/profile_invalidation_provider.h" |
| 29 #include "components/signin/core/browser/signin_manager.h" | 29 #include "components/signin/core/browser/signin_manager.h" |
| 30 #include "components/sync_driver/data_type_manager_impl.h" | 30 #include "components/sync_driver/data_type_manager_impl.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 void CreateService(ProfileSyncServiceStartBehavior behavior) { | 189 void CreateService(ProfileSyncServiceStartBehavior behavior) { |
| 190 SigninManagerBase* signin = | 190 SigninManagerBase* signin = |
| 191 SigninManagerFactory::GetForProfile(profile_); | 191 SigninManagerFactory::GetForProfile(profile_); |
| 192 signin->SetAuthenticatedUsername("test"); | 192 signin->SetAuthenticatedUsername("test"); |
| 193 ProfileOAuth2TokenService* oauth2_token_service = | 193 ProfileOAuth2TokenService* oauth2_token_service = |
| 194 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); | 194 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_); |
| 195 components_factory_ = new StrictMock<ProfileSyncComponentsFactoryMock>(); | 195 components_factory_ = new StrictMock<ProfileSyncComponentsFactoryMock>(); |
| 196 service_.reset(new ProfileSyncService( | 196 service_.reset(new ProfileSyncService( |
| 197 components_factory_, | 197 components_factory_, |
| 198 profile_, | 198 profile_, |
| 199 make_scoped_ptr(new ManagedUserSigninManagerWrapper(profile_, signin)), | 199 make_scoped_ptr(new SupervisedUserSigninManagerWrapper(profile_, |
| 200 signin)), |
| 200 oauth2_token_service, | 201 oauth2_token_service, |
| 201 behavior)); | 202 behavior)); |
| 202 service_->SetClearingBrowseringDataForTesting( | 203 service_->SetClearingBrowseringDataForTesting( |
| 203 base::Bind(&ProfileSyncServiceTest::ClearBrowsingDataCallback, | 204 base::Bind(&ProfileSyncServiceTest::ClearBrowsingDataCallback, |
| 204 base::Unretained(this))); | 205 base::Unretained(this))); |
| 205 } | 206 } |
| 206 | 207 |
| 207 #if defined(OS_WIN) || defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_C
HROMEOS)) | 208 #if defined(OS_WIN) || defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_C
HROMEOS)) |
| 208 void CreateServiceWithoutSignIn() { | 209 void CreateServiceWithoutSignIn() { |
| 209 CreateService(browser_sync::MANUAL_START); | 210 CreateService(browser_sync::MANUAL_START); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // See that we can override the URL with a flag. | 590 // See that we can override the URL with a flag. |
| 590 CommandLine command_line( | 591 CommandLine command_line( |
| 591 base::FilePath(base::FilePath(FILE_PATH_LITERAL("chrome.exe")))); | 592 base::FilePath(base::FilePath(FILE_PATH_LITERAL("chrome.exe")))); |
| 592 command_line.AppendSwitchASCII(switches::kSyncServiceURL, "https://foo/bar"); | 593 command_line.AppendSwitchASCII(switches::kSyncServiceURL, "https://foo/bar"); |
| 593 EXPECT_EQ("https://foo/bar", | 594 EXPECT_EQ("https://foo/bar", |
| 594 ProfileSyncService::GetSyncServiceURL(command_line).spec()); | 595 ProfileSyncService::GetSyncServiceURL(command_line).spec()); |
| 595 } | 596 } |
| 596 | 597 |
| 597 } // namespace | 598 } // namespace |
| 598 } // namespace browser_sync | 599 } // namespace browser_sync |
| OLD | NEW |