test_attempt_state.cc revision bda42a81ee5f9b20d2bebedcf0bbef1e30e5b293
1// Copyright (c) 2010 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#include "chrome/browser/chromeos/login/test_attempt_state.h"
6
7#include <string>
8
9#include "chrome/common/net/gaia/gaia_auth_consumer.h"
10#include "cros/chromeos_cryptohome.h"
11
12namespace chromeos {
13
14TestAttemptState::TestAttemptState(const std::string& username,
15                                   const std::string& password,
16                                   const std::string& ascii_hash,
17                                   const std::string& login_token,
18                                   const std::string& login_captcha)
19    : AuthAttemptState(username,
20                       password,
21                       ascii_hash,
22                       login_token,
23                       login_captcha) {
24}
25
26TestAttemptState::~TestAttemptState() {}
27
28void TestAttemptState::PresetOnlineLoginStatus(
29    const GaiaAuthConsumer::ClientLoginResult& credentials,
30    const LoginFailure& outcome) {
31  online_complete_ = true;
32  online_outcome_ = outcome;
33  credentials_ = credentials;
34}
35
36void TestAttemptState::PresetOfflineLoginStatus(bool offline_outcome,
37                                                int offline_code) {
38  offline_complete_ = true;
39  offline_outcome_ = offline_outcome;
40  offline_code_ = offline_code;
41}
42
43}  // namespace chromeos
44