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.
5 #include "chromeos/login/auth/test_attempt_state.h"
7 #include "components/user_manager/user_type.h"
8 #include "google_apis/gaia/gaia_auth_consumer.h"
12 TestAttemptState::TestAttemptState(const UserContext
& credentials
,
13 const bool user_is_new
)
14 : AuthAttemptState(credentials
,
15 user_manager::USER_TYPE_REGULAR
,
17 false, // online_complete
21 TestAttemptState::~TestAttemptState() {
24 void TestAttemptState::PresetOnlineLoginStatus(const AuthFailure
& outcome
) {
25 online_complete_
= true;
26 online_outcome_
= outcome
;
29 void TestAttemptState::DisableHosted() {
30 hosted_policy_
= GaiaAuthFetcher::HostedAccountsNotAllowed
;
33 void TestAttemptState::PresetCryptohomeStatus(
34 bool cryptohome_outcome
,
35 cryptohome::MountError cryptohome_code
) {
36 cryptohome_complete_
= true;
37 cryptohome_outcome_
= cryptohome_outcome
;
38 cryptohome_code_
= cryptohome_code
;
41 bool TestAttemptState::online_complete() {
42 return online_complete_
;
45 const AuthFailure
& TestAttemptState::online_outcome() {
46 return online_outcome_
;
49 bool TestAttemptState::is_first_time_user() {
50 return is_first_time_user_
;
53 GaiaAuthFetcher::HostedAccountsSetting
TestAttemptState::hosted_policy() {
54 return hosted_policy_
;
57 bool TestAttemptState::cryptohome_complete() {
58 return cryptohome_complete_
;
61 bool TestAttemptState::cryptohome_outcome() {
62 return cryptohome_outcome_
;
65 cryptohome::MountError
TestAttemptState::cryptohome_code() {
66 return cryptohome_code_
;
69 } // namespace chromeos