| 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 "components/signin/core/browser/signin_manager.h" | 5 #include "components/signin/core/browser/signin_manager.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 std::string gaia_id = "12345"; | 275 std::string gaia_id = "12345"; |
| 276 std::string email = "user@google.com"; | 276 std::string email = "user@google.com"; |
| 277 | 277 |
| 278 AccountTrackerService* account_tracker_service = | 278 AccountTrackerService* account_tracker_service = |
| 279 AccountTrackerServiceFactory::GetForProfile(profile()); | 279 AccountTrackerServiceFactory::GetForProfile(profile()); |
| 280 account_tracker_service->SeedAccountInfo(gaia_id, email); | 280 account_tracker_service->SeedAccountInfo(gaia_id, email); |
| 281 FakeAccountFetcherService* account_fetcher_service = | 281 FakeAccountFetcherService* account_fetcher_service = |
| 282 static_cast<FakeAccountFetcherService*>( | 282 static_cast<FakeAccountFetcherService*>( |
| 283 AccountFetcherServiceFactory::GetForProfile(profile())); | 283 AccountFetcherServiceFactory::GetForProfile(profile())); |
| 284 account_fetcher_service->EnableNetworkFetches(); | 284 account_fetcher_service->OnRefreshTokensLoaded(); |
| 285 | 285 |
| 286 ASSERT_TRUE(signin_client()->get_signed_in_password().empty()); | 286 ASSERT_TRUE(signin_client()->get_signed_in_password().empty()); |
| 287 | 287 |
| 288 manager_->StartSignInWithRefreshToken( | 288 manager_->StartSignInWithRefreshToken( |
| 289 "rt1", | 289 "rt1", |
| 290 gaia_id, | 290 gaia_id, |
| 291 email, | 291 email, |
| 292 "password", | 292 "password", |
| 293 SigninManager::OAuthTokenFetchedCallback()); | 293 SigninManager::OAuthTokenFetchedCallback()); |
| 294 | 294 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 584 |
| 585 EXPECT_EQ(gaia_id, manager_->GetAuthenticatedAccountId()); | 585 EXPECT_EQ(gaia_id, manager_->GetAuthenticatedAccountId()); |
| 586 EXPECT_EQ(gaia_id, profile()->GetPrefs()->GetString( | 586 EXPECT_EQ(gaia_id, profile()->GetPrefs()->GetString( |
| 587 prefs::kGoogleServicesAccountId)); | 587 prefs::kGoogleServicesAccountId)); |
| 588 | 588 |
| 589 base::RunLoop().RunUntilIdle(); | 589 base::RunLoop().RunUntilIdle(); |
| 590 EXPECT_EQ(AccountTrackerService::MIGRATION_DONE, | 590 EXPECT_EQ(AccountTrackerService::MIGRATION_DONE, |
| 591 tracker->GetMigrationState()); | 591 tracker->GetMigrationState()); |
| 592 } | 592 } |
| 593 } | 593 } |
| OLD | NEW |