OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <utility> |
| 6 |
5 #include "base/command_line.h" | 7 #include "base/command_line.h" |
6 #include "base/macros.h" | 8 #include "base/macros.h" |
7 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
8 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
10 #include "base/test/histogram_tester.h" | 12 #include "base/test/histogram_tester.h" |
11 #include "base/time/time.h" | 13 #include "base/time/time.h" |
12 #include "build/build_config.h" | 14 #include "build/build_config.h" |
13 #include "chrome/browser/signin/account_reconcilor_factory.h" | 15 #include "chrome/browser/signin/account_reconcilor_factory.h" |
14 #include "chrome/browser/signin/account_tracker_service_factory.h" | 16 #include "chrome/browser/signin/account_tracker_service_factory.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // static | 62 // static |
61 scoped_ptr<KeyedService> MockAccountReconcilor::Build( | 63 scoped_ptr<KeyedService> MockAccountReconcilor::Build( |
62 content::BrowserContext* context) { | 64 content::BrowserContext* context) { |
63 Profile* profile = Profile::FromBrowserContext(context); | 65 Profile* profile = Profile::FromBrowserContext(context); |
64 scoped_ptr<AccountReconcilor> reconcilor(new MockAccountReconcilor( | 66 scoped_ptr<AccountReconcilor> reconcilor(new MockAccountReconcilor( |
65 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 67 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
66 SigninManagerFactory::GetForProfile(profile), | 68 SigninManagerFactory::GetForProfile(profile), |
67 ChromeSigninClientFactory::GetForProfile(profile), | 69 ChromeSigninClientFactory::GetForProfile(profile), |
68 GaiaCookieManagerServiceFactory::GetForProfile(profile))); | 70 GaiaCookieManagerServiceFactory::GetForProfile(profile))); |
69 reconcilor->Initialize(false /* start_reconcile_if_tokens_available */); | 71 reconcilor->Initialize(false /* start_reconcile_if_tokens_available */); |
70 return reconcilor.Pass(); | 72 return std::move(reconcilor); |
71 } | 73 } |
72 | 74 |
73 MockAccountReconcilor::MockAccountReconcilor( | 75 MockAccountReconcilor::MockAccountReconcilor( |
74 ProfileOAuth2TokenService* token_service, | 76 ProfileOAuth2TokenService* token_service, |
75 SigninManagerBase* signin_manager, | 77 SigninManagerBase* signin_manager, |
76 SigninClient* client, | 78 SigninClient* client, |
77 GaiaCookieManagerService* cookie_manager_service) | 79 GaiaCookieManagerService* cookie_manager_service) |
78 : testing::StrictMock<AccountReconcilor>(token_service, | 80 : testing::StrictMock<AccountReconcilor>(token_service, |
79 signin_manager, | 81 signin_manager, |
80 client, | 82 client, |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 base::RunLoop().RunUntilIdle(); | 904 base::RunLoop().RunUntilIdle(); |
903 ASSERT_FALSE(reconcilor->is_reconcile_started_); | 905 ASSERT_FALSE(reconcilor->is_reconcile_started_); |
904 ASSERT_FALSE(reconcilor->error_during_last_reconcile_); | 906 ASSERT_FALSE(reconcilor->error_during_last_reconcile_); |
905 } | 907 } |
906 | 908 |
907 #endif // OS_IOS | 909 #endif // OS_IOS |
908 | 910 |
909 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled, | 911 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled, |
910 AccountReconcilorTest, | 912 AccountReconcilorTest, |
911 testing::Bool()); | 913 testing::Bool()); |
OLD | NEW |