| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TEST_ATTEMPT_STATE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_TEST_ATTEMPT_STATE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TEST_ATTEMPT_STATE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_TEST_ATTEMPT_STATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/chromeos/login/auth_attempt_state.h" | 12 #include "chrome/browser/chromeos/login/auth_attempt_state.h" |
| 12 #include "chrome/browser/chromeos/login/login_status_consumer.h" | 13 #include "chrome/browser/chromeos/login/login_status_consumer.h" |
| 13 #include "chrome/common/net/gaia/gaia_auth_consumer.h" | 14 #include "chrome/common/net/gaia/gaia_auth_consumer.h" |
| 14 | 15 |
| 15 namespace chromeos { | 16 namespace chromeos { |
| 16 | 17 |
| 17 class TestAttemptState : public AuthAttemptState { | 18 class TestAttemptState : public AuthAttemptState { |
| 18 public: | 19 public: |
| 19 TestAttemptState(const std::string& username, | 20 TestAttemptState(const std::string& username, |
| 20 const std::string& password, | 21 const std::string& password, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 32 const GaiaAuthConsumer::ClientLoginResult& credentials, | 33 const GaiaAuthConsumer::ClientLoginResult& credentials, |
| 33 const LoginFailure& outcome); | 34 const LoginFailure& outcome); |
| 34 | 35 |
| 35 // The next attempt will not allow HOSTED accounts to log in. | 36 // The next attempt will not allow HOSTED accounts to log in. |
| 36 void DisableHosted(); | 37 void DisableHosted(); |
| 37 | 38 |
| 38 // Act as though an cryptohome login attempt completed already. | 39 // Act as though an cryptohome login attempt completed already. |
| 39 void PresetCryptohomeStatus(bool cryptohome_outcome, int cryptohome_code); | 40 void PresetCryptohomeStatus(bool cryptohome_outcome, int cryptohome_code); |
| 40 | 41 |
| 41 // To allow state to be queried on the main thread during tests. | 42 // To allow state to be queried on the main thread during tests. |
| 42 virtual bool online_complete(); | 43 virtual bool online_complete() OVERRIDE; |
| 43 virtual const LoginFailure& online_outcome(); | 44 virtual const LoginFailure& online_outcome() OVERRIDE; |
| 44 virtual const GaiaAuthConsumer::ClientLoginResult& credentials(); | 45 virtual const GaiaAuthConsumer::ClientLoginResult& credentials() OVERRIDE; |
| 45 virtual bool is_first_time_user(); | 46 virtual bool is_first_time_user() OVERRIDE; |
| 46 virtual GaiaAuthFetcher::HostedAccountsSetting hosted_policy(); | 47 virtual GaiaAuthFetcher::HostedAccountsSetting hosted_policy() OVERRIDE; |
| 47 virtual bool cryptohome_complete(); | 48 virtual bool cryptohome_complete() OVERRIDE; |
| 48 virtual bool cryptohome_outcome(); | 49 virtual bool cryptohome_outcome() OVERRIDE; |
| 49 virtual int cryptohome_code(); | 50 virtual int cryptohome_code() OVERRIDE; |
| 50 | 51 |
| 51 private: | 52 private: |
| 52 DISALLOW_COPY_AND_ASSIGN(TestAttemptState); | 53 DISALLOW_COPY_AND_ASSIGN(TestAttemptState); |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 } // namespace chromeos | 56 } // namespace chromeos |
| 56 | 57 |
| 57 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEST_ATTEMPT_STATE_H_ | 58 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_TEST_ATTEMPT_STATE_H_ |
| OLD | NEW |