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"
13 MockAuthStatusConsumer::MockAuthStatusConsumer() {
16 MockAuthStatusConsumer::~MockAuthStatusConsumer() {
20 void MockAuthStatusConsumer::OnRetailModeSuccessQuit(
21 const UserContext
& user_context
) {
22 base::MessageLoop::current()->Quit();
26 void MockAuthStatusConsumer::OnRetailModeSuccessQuitAndFail(
27 const UserContext
& user_context
) {
28 ADD_FAILURE() << "Retail mode login should have failed!";
29 base::MessageLoop::current()->Quit();
33 void MockAuthStatusConsumer::OnGuestSuccessQuit() {
34 base::MessageLoop::current()->Quit();
38 void MockAuthStatusConsumer::OnGuestSuccessQuitAndFail() {
39 ADD_FAILURE() << "Guest login should have failed!";
40 base::MessageLoop::current()->Quit();
44 void MockAuthStatusConsumer::OnSuccessQuit(const UserContext
& user_context
) {
45 base::MessageLoop::current()->Quit();
49 void MockAuthStatusConsumer::OnSuccessQuitAndFail(
50 const UserContext
& user_context
) {
51 ADD_FAILURE() << "Login should NOT have succeeded!";
52 base::MessageLoop::current()->Quit();
56 void MockAuthStatusConsumer::OnFailQuit(const AuthFailure
& error
) {
57 base::MessageLoop::current()->Quit();
61 void MockAuthStatusConsumer::OnFailQuitAndFail(const AuthFailure
& error
) {
62 ADD_FAILURE() << "Login should not have failed!";
63 base::MessageLoop::current()->Quit();
67 void MockAuthStatusConsumer::OnMigrateQuit() {
68 base::MessageLoop::current()->Quit();
72 void MockAuthStatusConsumer::OnMigrateQuitAndFail() {
73 ADD_FAILURE() << "Should not have detected a PW change!";
74 base::MessageLoop::current()->Quit();
77 } // namespace chromeos