| 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 "chrome/browser/chromeos/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 // If there was no work then quit the fake IO loop. | 351 // If there was no work then quit the fake IO loop. |
| 352 return has_work; | 352 return has_work; |
| 353 } | 353 } |
| 354 | 354 |
| 355 virtual void OnProfilePrepared(Profile* profile) OVERRIDE { | 355 virtual void OnProfilePrepared(Profile* profile) OVERRIDE { |
| 356 EXPECT_FALSE(prepared_profile_); | 356 EXPECT_FALSE(prepared_profile_); |
| 357 prepared_profile_ = profile; | 357 prepared_profile_ = profile; |
| 358 } | 358 } |
| 359 | 359 |
| 360 #if defined(ENABLE_RLZ) | 360 #if defined(ENABLE_RLZ) |
| 361 virtual void OnRlzInitialized(Profile* profile) OVERRIDE { | 361 virtual void OnRlzInitialized() OVERRIDE { |
| 362 rlz_initialized_cb_.Run(); | 362 rlz_initialized_cb_.Run(); |
| 363 } | 363 } |
| 364 #endif | 364 #endif |
| 365 | 365 |
| 366 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE { | 366 virtual void OnLoginFailure(const LoginFailure& error) OVERRIDE { |
| 367 FAIL() << "OnLoginFailure not expected"; | 367 FAIL() << "OnLoginFailure not expected"; |
| 368 } | 368 } |
| 369 | 369 |
| 370 virtual void OnLoginSuccess(const UserContext& user_context) OVERRIDE { | 370 virtual void OnLoginSuccess(const UserContext& user_context) OVERRIDE { |
| 371 FAIL() << "OnLoginSuccess not expected"; | 371 FAIL() << "OnLoginSuccess not expected"; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 user_context.SetUserIDHash(username); | 404 user_context.SetUserIDHash(username); |
| 405 authenticator->CompleteLogin(ProfileHelper::GetSigninProfile(), | 405 authenticator->CompleteLogin(ProfileHelper::GetSigninProfile(), |
| 406 user_context); | 406 user_context); |
| 407 | 407 |
| 408 // Setting |kHasCookies| to false prevents ProfileAuthData::Transfer from | 408 // Setting |kHasCookies| to false prevents ProfileAuthData::Transfer from |
| 409 // waiting for an IO task before proceeding. | 409 // waiting for an IO task before proceeding. |
| 410 const bool kHasCookies = false; | 410 const bool kHasCookies = false; |
| 411 const bool kHasActiveSession = false; | 411 const bool kHasActiveSession = false; |
| 412 user_context.SetAuthFlow(UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML); | 412 user_context.SetAuthFlow(UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML); |
| 413 LoginUtils::Get()->PrepareProfile(user_context, | 413 LoginUtils::Get()->PrepareProfile(user_context, |
| 414 std::string(), | |
| 415 kHasCookies, | 414 kHasCookies, |
| 416 kHasActiveSession, | 415 kHasActiveSession, |
| 417 this); | 416 this); |
| 418 device_settings_test_helper.Flush(); | 417 device_settings_test_helper.Flush(); |
| 419 RunUntilIdle(); | 418 RunUntilIdle(); |
| 420 | 419 |
| 421 DeviceSettingsService::Get()->UnsetSessionManager(); | 420 DeviceSettingsService::Get()->UnsetSessionManager(); |
| 422 } | 421 } |
| 423 | 422 |
| 424 net::TestURLFetcher* PrepareOAuthFetcher(const GURL& expected_url) { | 423 net::TestURLFetcher* PrepareOAuthFetcher(const GURL& expected_url) { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 } | 697 } |
| 699 | 698 |
| 700 INSTANTIATE_TEST_CASE_P( | 699 INSTANTIATE_TEST_CASE_P( |
| 701 LoginUtilsBlockingLoginTestInstance, | 700 LoginUtilsBlockingLoginTestInstance, |
| 702 LoginUtilsBlockingLoginTest, | 701 LoginUtilsBlockingLoginTest, |
| 703 testing::Values(0, 1, 2, 3, 4, 5)); | 702 testing::Values(0, 1, 2, 3, 4, 5)); |
| 704 | 703 |
| 705 } // namespace | 704 } // namespace |
| 706 | 705 |
| 707 } // namespace chromeos | 706 } // namespace chromeos |
| OLD | NEW |