Roll src/third_party/WebKit abe9e39c:3d349bd (svn 182659:182669)
[chromium-blink-merge.git] / chromeos / login / auth / mock_auth_status_consumer.cc
blobabf6e96908a1fbbc9b615b149f01f0171616fbef
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/mock_auth_status_consumer.h"
7 #include "base/message_loop/message_loop.h"
8 #include "google_apis/gaia/gaia_auth_consumer.h"
9 #include "testing/gtest/include/gtest/gtest.h"
11 namespace chromeos {
13 MockAuthStatusConsumer::MockAuthStatusConsumer() {
16 MockAuthStatusConsumer::~MockAuthStatusConsumer() {
19 // static
20 void MockAuthStatusConsumer::OnRetailModeSuccessQuit(
21 const UserContext& user_context) {
22 base::MessageLoop::current()->Quit();
25 // static
26 void MockAuthStatusConsumer::OnRetailModeSuccessQuitAndFail(
27 const UserContext& user_context) {
28 ADD_FAILURE() << "Retail mode login should have failed!";
29 base::MessageLoop::current()->Quit();
32 // static
33 void MockAuthStatusConsumer::OnGuestSuccessQuit() {
34 base::MessageLoop::current()->Quit();
37 // static
38 void MockAuthStatusConsumer::OnGuestSuccessQuitAndFail() {
39 ADD_FAILURE() << "Guest login should have failed!";
40 base::MessageLoop::current()->Quit();
43 // static
44 void MockAuthStatusConsumer::OnSuccessQuit(const UserContext& user_context) {
45 base::MessageLoop::current()->Quit();
48 // static
49 void MockAuthStatusConsumer::OnSuccessQuitAndFail(
50 const UserContext& user_context) {
51 ADD_FAILURE() << "Login should NOT have succeeded!";
52 base::MessageLoop::current()->Quit();
55 // static
56 void MockAuthStatusConsumer::OnFailQuit(const AuthFailure& error) {
57 base::MessageLoop::current()->Quit();
60 // static
61 void MockAuthStatusConsumer::OnFailQuitAndFail(const AuthFailure& error) {
62 ADD_FAILURE() << "Login should not have failed!";
63 base::MessageLoop::current()->Quit();
66 // static
67 void MockAuthStatusConsumer::OnMigrateQuit() {
68 base::MessageLoop::current()->Quit();
71 // static
72 void MockAuthStatusConsumer::OnMigrateQuitAndFail() {
73 ADD_FAILURE() << "Should not have detected a PW change!";
74 base::MessageLoop::current()->Quit();
77 } // namespace chromeos