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" |
26 #include "chrome/browser/sync/profile_sync_service_factory.h" | 27 #include "chrome/browser/sync/profile_sync_service_factory.h" |
27 #include "chrome/browser/sync/test_profile_sync_service.h" | 28 #include "chrome/browser/sync/test_profile_sync_service.h" |
28 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 29 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
29 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 30 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
30 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 31 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
31 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
32 #include "chrome/test/base/chrome_render_view_host_test_harness.h" | 33 #include "chrome/test/base/chrome_render_view_host_test_harness.h" |
33 #include "chrome/test/base/testing_browser_process.h" | 34 #include "chrome/test/base/testing_browser_process.h" |
34 #include "chrome/test/base/testing_pref_service_syncable.h" | 35 #include "chrome/test/base/testing_pref_service_syncable.h" |
35 #include "chrome/test/base/testing_profile.h" | 36 #include "chrome/test/base/testing_profile.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 first_setup_in_progress_ = in_progress; | 196 first_setup_in_progress_ = in_progress; |
196 } | 197 } |
197 | 198 |
198 void set_sync_initialized(bool initialized) { | 199 void set_sync_initialized(bool initialized) { |
199 sync_initialized_ = initialized; | 200 sync_initialized_ = initialized; |
200 } | 201 } |
201 | 202 |
202 private: | 203 private: |
203 explicit OneClickTestProfileSyncService(Profile* profile) | 204 explicit OneClickTestProfileSyncService(Profile* profile) |
204 : TestProfileSyncService( | 205 : TestProfileSyncService( |
205 NULL, | 206 scoped_ptr<ProfileSyncComponentsFactory>( |
| 207 new ProfileSyncComponentsFactoryMock()), |
206 profile, | 208 profile, |
207 SigninManagerFactory::GetForProfile(profile), | 209 SigninManagerFactory::GetForProfile(profile), |
208 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 210 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
209 browser_sync::MANUAL_START), | 211 browser_sync::MANUAL_START), |
210 first_setup_in_progress_(false), | 212 first_setup_in_progress_(false), |
211 sync_initialized_(false) {} | 213 sync_initialized_(false) {} |
212 | 214 |
213 bool first_setup_in_progress_; | 215 bool first_setup_in_progress_; |
214 bool sync_initialized_; | 216 bool sync_initialized_; |
215 }; | 217 }; |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1012 args.email = "foo@gmail.com"; | 1014 args.email = "foo@gmail.com"; |
1013 args.profile = profile(); | 1015 args.profile = profile(); |
1014 MockStarterWrapper* wrapper = new MockStarterWrapper( | 1016 MockStarterWrapper* wrapper = new MockStarterWrapper( |
1015 args, OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); | 1017 args, OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); |
1016 SetCookie("LSID=1234; domain=google.com; secure; httponly"); | 1018 SetCookie("LSID=1234; domain=google.com; secure; httponly"); |
1017 | 1019 |
1018 EXPECT_CALL(*wrapper, DisplayErrorBubble(_)); | 1020 EXPECT_CALL(*wrapper, DisplayErrorBubble(_)); |
1019 wrapper->Start(); | 1021 wrapper->Start(); |
1020 base::RunLoop().RunUntilIdle(); | 1022 base::RunLoop().RunUntilIdle(); |
1021 } | 1023 } |
OLD | NEW |