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::PresetCryptohomeStatus(
28 bool cryptohome_outcome
,
29 cryptohome::MountError cryptohome_code
) {
30 cryptohome_complete_
= true;
31 cryptohome_outcome_
= cryptohome_outcome
;
32 cryptohome_code_
= cryptohome_code
;
35 bool TestAttemptState::online_complete() {
36 return online_complete_
;
39 const AuthFailure
& TestAttemptState::online_outcome() {
40 return online_outcome_
;
43 bool TestAttemptState::is_first_time_user() {
44 return is_first_time_user_
;
47 bool TestAttemptState::cryptohome_complete() {
48 return cryptohome_complete_
;
51 bool TestAttemptState::cryptohome_outcome() {
52 return cryptohome_outcome_
;
55 cryptohome::MountError
TestAttemptState::cryptohome_code() {
56 return cryptohome_code_
;
59 } // namespace chromeos