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"
11 TestAttemptState::TestAttemptState(const UserContext
& credentials
,
12 const bool user_is_new
)
13 : AuthAttemptState(credentials
,
15 false, // online_complete
19 TestAttemptState::~TestAttemptState() {
22 void TestAttemptState::PresetOnlineLoginStatus(const AuthFailure
& outcome
) {
23 online_complete_
= true;
24 online_outcome_
= outcome
;
27 void TestAttemptState::DisableHosted() {
28 hosted_policy_
= GaiaAuthFetcher::HostedAccountsNotAllowed
;
31 void TestAttemptState::PresetCryptohomeStatus(
32 bool cryptohome_outcome
,
33 cryptohome::MountError cryptohome_code
) {
34 cryptohome_complete_
= true;
35 cryptohome_outcome_
= cryptohome_outcome
;
36 cryptohome_code_
= cryptohome_code
;
39 bool TestAttemptState::online_complete() {
40 return online_complete_
;
43 const AuthFailure
& TestAttemptState::online_outcome() {
44 return online_outcome_
;
47 bool TestAttemptState::is_first_time_user() {
48 return is_first_time_user_
;
51 GaiaAuthFetcher::HostedAccountsSetting
TestAttemptState::hosted_policy() {
52 return hosted_policy_
;
55 bool TestAttemptState::cryptohome_complete() {
56 return cryptohome_complete_
;
59 bool TestAttemptState::cryptohome_outcome() {
60 return cryptohome_outcome_
;
63 cryptohome::MountError
TestAttemptState::cryptohome_code() {
64 return cryptohome_code_
;
67 } // namespace chromeos