1 // Copyright (c) 2012 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 "chrome/browser/chromeos/login/test_attempt_state.h"
9 #include "google_apis/gaia/gaia_auth_consumer.h"
13 TestAttemptState::TestAttemptState(const UserContext
& credentials
,
14 const std::string
& login_token
,
15 const std::string
& login_captcha
,
16 const User::UserType user_type
,
17 const bool user_is_new
)
18 : AuthAttemptState(credentials
,
25 TestAttemptState::~TestAttemptState() {}
27 void TestAttemptState::PresetOnlineLoginStatus(
28 const LoginFailure
& outcome
) {
29 online_complete_
= true;
30 online_outcome_
= outcome
;
33 void TestAttemptState::DisableHosted() {
34 hosted_policy_
= GaiaAuthFetcher::HostedAccountsNotAllowed
;
37 void TestAttemptState::PresetCryptohomeStatus(
38 bool cryptohome_outcome
,
39 cryptohome::MountError cryptohome_code
) {
40 cryptohome_complete_
= true;
41 cryptohome_outcome_
= cryptohome_outcome
;
42 cryptohome_code_
= cryptohome_code
;
45 bool TestAttemptState::online_complete() {
46 return online_complete_
;
49 const LoginFailure
& TestAttemptState::online_outcome() {
50 return online_outcome_
;
53 bool TestAttemptState::is_first_time_user() {
54 return is_first_time_user_
;
57 GaiaAuthFetcher::HostedAccountsSetting
TestAttemptState::hosted_policy() {
58 return hosted_policy_
;
61 bool TestAttemptState::cryptohome_complete() {
62 return cryptohome_complete_
;
65 bool TestAttemptState::cryptohome_outcome() {
66 return cryptohome_outcome_
;
69 cryptohome::MountError
TestAttemptState::cryptohome_code() {
70 return cryptohome_code_
;
73 } // namespace chromeos