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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "components/signin/core/browser/account_reconcilor.h" | 28 #include "components/signin/core/browser/account_reconcilor.h" |
29 #include "components/signin/core/browser/account_tracker_service.h" | 29 #include "components/signin/core/browser/account_tracker_service.h" |
30 #include "components/signin/core/browser/fake_gaia_cookie_manager_service.h" | 30 #include "components/signin/core/browser/fake_gaia_cookie_manager_service.h" |
31 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" | 31 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" |
32 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 32 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
33 #include "components/signin/core/browser/signin_manager.h" | 33 #include "components/signin/core/browser/signin_manager.h" |
34 #include "components/signin/core/browser/signin_metrics.h" | 34 #include "components/signin/core/browser/signin_metrics.h" |
35 #include "components/signin/core/browser/test_signin_client.h" | 35 #include "components/signin/core/browser/test_signin_client.h" |
36 #include "components/signin/core/common/profile_management_switches.h" | 36 #include "components/signin/core/common/profile_management_switches.h" |
37 #include "components/signin/core/common/signin_switches.h" | 37 #include "components/signin/core/common/signin_switches.h" |
38 #include "components/syncable_prefs/pref_service_syncable.h" | 38 #include "components/sync_preferences/pref_service_syncable.h" |
39 #include "content/public/test/test_browser_thread_bundle.h" | 39 #include "content/public/test/test_browser_thread_bundle.h" |
40 #include "google_apis/gaia/fake_oauth2_token_service_delegate.h" | 40 #include "google_apis/gaia/fake_oauth2_token_service_delegate.h" |
41 #include "google_apis/gaia/gaia_constants.h" | 41 #include "google_apis/gaia/gaia_constants.h" |
42 #include "google_apis/gaia/gaia_urls.h" | 42 #include "google_apis/gaia/gaia_urls.h" |
43 #include "net/url_request/test_url_fetcher_factory.h" | 43 #include "net/url_request/test_url_fetcher_factory.h" |
44 #include "testing/gmock/include/gmock/gmock.h" | 44 #include "testing/gmock/include/gmock/gmock.h" |
45 #include "testing/gtest/include/gtest/gtest.h" | 45 #include "testing/gtest/include/gtest/gtest.h" |
46 | 46 |
47 namespace { | 47 namespace { |
48 | 48 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 BuildFakeProfileOAuth2TokenService)); | 181 BuildFakeProfileOAuth2TokenService)); |
182 factories.push_back( | 182 factories.push_back( |
183 std::make_pair(GaiaCookieManagerServiceFactory::GetInstance(), | 183 std::make_pair(GaiaCookieManagerServiceFactory::GetInstance(), |
184 BuildFakeGaiaCookieManagerService)); | 184 BuildFakeGaiaCookieManagerService)); |
185 factories.push_back(std::make_pair(SigninManagerFactory::GetInstance(), | 185 factories.push_back(std::make_pair(SigninManagerFactory::GetInstance(), |
186 BuildFakeSigninManagerBase)); | 186 BuildFakeSigninManagerBase)); |
187 factories.push_back(std::make_pair(AccountReconcilorFactory::GetInstance(), | 187 factories.push_back(std::make_pair(AccountReconcilorFactory::GetInstance(), |
188 MockAccountReconcilor::Build)); | 188 MockAccountReconcilor::Build)); |
189 | 189 |
190 profile_ = testing_profile_manager_.get()->CreateTestingProfile( | 190 profile_ = testing_profile_manager_.get()->CreateTestingProfile( |
191 "name", std::unique_ptr<syncable_prefs::PrefServiceSyncable>(), | 191 "name", std::unique_ptr<sync_preferences::PrefServiceSyncable>(), |
192 base::UTF8ToUTF16("name"), 0, std::string(), factories); | 192 base::UTF8ToUTF16("name"), 0, std::string(), factories); |
193 | 193 |
194 test_signin_client_ = | 194 test_signin_client_ = |
195 static_cast<TestSigninClient*>( | 195 static_cast<TestSigninClient*>( |
196 ChromeSigninClientFactory::GetForProfile(profile())); | 196 ChromeSigninClientFactory::GetForProfile(profile())); |
197 | 197 |
198 token_service_ = | 198 token_service_ = |
199 static_cast<FakeProfileOAuth2TokenService*>( | 199 static_cast<FakeProfileOAuth2TokenService*>( |
200 ProfileOAuth2TokenServiceFactory::GetForProfile(profile())); | 200 ProfileOAuth2TokenServiceFactory::GetForProfile(profile())); |
201 | 201 |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 SimulateAddAccountToCookieCompleted( | 905 SimulateAddAccountToCookieCompleted( |
906 reconcilor, account_id1, GoogleServiceAuthError::AuthErrorNone()); | 906 reconcilor, account_id1, GoogleServiceAuthError::AuthErrorNone()); |
907 base::RunLoop().RunUntilIdle(); | 907 base::RunLoop().RunUntilIdle(); |
908 ASSERT_FALSE(reconcilor->is_reconcile_started_); | 908 ASSERT_FALSE(reconcilor->is_reconcile_started_); |
909 ASSERT_FALSE(reconcilor->error_during_last_reconcile_); | 909 ASSERT_FALSE(reconcilor->error_during_last_reconcile_); |
910 } | 910 } |
911 | 911 |
912 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled, | 912 INSTANTIATE_TEST_CASE_P(AccountReconcilorMaybeEnabled, |
913 AccountReconcilorTest, | 913 AccountReconcilorTest, |
914 testing::Bool()); | 914 testing::Bool()); |
OLD | NEW |