| 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/scoped_user_pref_update.h" | 6 #include "base/prefs/scoped_user_pref_update.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| 11 #include "chrome/browser/content_settings/cookie_settings.h" | 11 #include "chrome/browser/content_settings/cookie_settings.h" |
| 12 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 12 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/profiles/profile_info_cache.h" | 14 #include "chrome/browser/profiles/profile_info_cache.h" |
| 15 #include "chrome/browser/profiles/profile_io_data.h" | 15 #include "chrome/browser/profiles/profile_io_data.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/signin/chrome_signin_client.h" | 17 #include "chrome/browser/signin/chrome_signin_client.h" |
| 18 #include "chrome/browser/signin/chrome_signin_client_factory.h" | 18 #include "chrome/browser/signin/chrome_signin_client_factory.h" |
| 19 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" | 19 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" |
| 20 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" | 20 #include "chrome/browser/signin/fake_profile_oauth2_token_service_builder.h" |
| 21 #include "chrome/browser/signin/fake_signin_manager.h" | 21 #include "chrome/browser/signin/fake_signin_manager.h" |
| 22 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 22 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 23 #include "chrome/browser/signin/signin_manager_factory.h" | 23 #include "chrome/browser/signin/signin_manager_factory.h" |
| 24 #include "chrome/browser/signin/signin_names_io_thread.h" | 24 #include "chrome/browser/signin/signin_names_io_thread.h" |
| 25 #include "chrome/browser/signin/signin_promo.h" | 25 #include "chrome/browser/signin/signin_promo.h" |
| 26 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | |
| 27 #include "chrome/browser/sync/profile_sync_service_factory.h" | 26 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 28 #include "chrome/browser/sync/test_profile_sync_service.h" | 27 #include "chrome/browser/sync/test_profile_sync_service.h" |
| 29 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 28 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 30 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 29 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 31 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 30 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 32 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
| 33 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 32 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| 34 #include "chrome/test/base/testing_browser_process.h" | 33 #include "chrome/test/base/testing_browser_process.h" |
| 35 #include "chrome/test/base/testing_pref_service_syncable.h" | 34 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 36 #include "chrome/test/base/testing_profile.h" | 35 #include "chrome/test/base/testing_profile.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 first_setup_in_progress_ = in_progress; | 195 first_setup_in_progress_ = in_progress; |
| 197 } | 196 } |
| 198 | 197 |
| 199 void set_sync_initialized(bool initialized) { | 198 void set_sync_initialized(bool initialized) { |
| 200 sync_initialized_ = initialized; | 199 sync_initialized_ = initialized; |
| 201 } | 200 } |
| 202 | 201 |
| 203 private: | 202 private: |
| 204 explicit OneClickTestProfileSyncService(Profile* profile) | 203 explicit OneClickTestProfileSyncService(Profile* profile) |
| 205 : TestProfileSyncService( | 204 : TestProfileSyncService( |
| 206 scoped_ptr<ProfileSyncComponentsFactory>( | 205 NULL, |
| 207 new ProfileSyncComponentsFactoryMock()), | |
| 208 profile, | 206 profile, |
| 209 SigninManagerFactory::GetForProfile(profile), | 207 SigninManagerFactory::GetForProfile(profile), |
| 210 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 208 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
| 211 browser_sync::MANUAL_START), | 209 browser_sync::MANUAL_START), |
| 212 first_setup_in_progress_(false), | 210 first_setup_in_progress_(false), |
| 213 sync_initialized_(false) {} | 211 sync_initialized_(false) {} |
| 214 | 212 |
| 215 bool first_setup_in_progress_; | 213 bool first_setup_in_progress_; |
| 216 bool sync_initialized_; | 214 bool sync_initialized_; |
| 217 }; | 215 }; |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 args.email = "foo@gmail.com"; | 1012 args.email = "foo@gmail.com"; |
| 1015 args.profile = profile(); | 1013 args.profile = profile(); |
| 1016 MockStarterWrapper* wrapper = new MockStarterWrapper( | 1014 MockStarterWrapper* wrapper = new MockStarterWrapper( |
| 1017 args, OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); | 1015 args, OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); |
| 1018 SetCookie("LSID=1234; domain=google.com; secure; httponly"); | 1016 SetCookie("LSID=1234; domain=google.com; secure; httponly"); |
| 1019 | 1017 |
| 1020 EXPECT_CALL(*wrapper, DisplayErrorBubble(_)); | 1018 EXPECT_CALL(*wrapper, DisplayErrorBubble(_)); |
| 1021 wrapper->Start(); | 1019 wrapper->Start(); |
| 1022 base::RunLoop().RunUntilIdle(); | 1020 base::RunLoop().RunUntilIdle(); |
| 1023 } | 1021 } |
| OLD | NEW |