OLD | NEW |
| (Empty) |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "chrome/browser/chromeos/login/auth/auth_attempt_state.h" | |
10 #include "chromeos/login/auth/auth_status_consumer.h" | |
11 #include "google_apis/gaia/gaia_auth_consumer.h" | |
12 | |
13 namespace chromeos { | |
14 | |
15 class UserContext; | |
16 | |
17 class TestAttemptState : public AuthAttemptState { | |
18 public: | |
19 TestAttemptState(const UserContext& credentials, const bool user_is_new); | |
20 | |
21 virtual ~TestAttemptState(); | |
22 | |
23 // Act as though an online login attempt completed already. | |
24 void PresetOnlineLoginStatus(const AuthFailure& outcome); | |
25 | |
26 // The next attempt will not allow HOSTED accounts to log in. | |
27 void DisableHosted(); | |
28 | |
29 // Act as though an cryptohome login attempt completed already. | |
30 void PresetCryptohomeStatus(bool cryptohome_outcome, | |
31 cryptohome::MountError cryptohome_code); | |
32 | |
33 // To allow state to be queried on the main thread during tests. | |
34 virtual bool online_complete() OVERRIDE; | |
35 virtual const AuthFailure& online_outcome() OVERRIDE; | |
36 virtual bool is_first_time_user() OVERRIDE; | |
37 virtual GaiaAuthFetcher::HostedAccountsSetting hosted_policy() OVERRIDE; | |
38 virtual bool cryptohome_complete() OVERRIDE; | |
39 virtual bool cryptohome_outcome() OVERRIDE; | |
40 virtual cryptohome::MountError cryptohome_code() OVERRIDE; | |
41 | |
42 private: | |
43 DISALLOW_COPY_AND_ASSIGN(TestAttemptState); | |
44 }; | |
45 | |
46 } // namespace chromeos | |
47 | |
48 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_TEST_ATTEMPT_STATE_H_ | |
OLD | NEW |