| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #include "chrome/browser/chromeos/login/mock_login_status_consumer.h" | |
| 6 | |
| 7 #include "base/message_loop/message_loop.h" | |
| 8 #include "chrome/browser/chromeos/login/user.h" | |
| 9 #include "google_apis/gaia/gaia_auth_consumer.h" | |
| 10 #include "testing/gtest/include/gtest/gtest.h" | |
| 11 | |
| 12 namespace chromeos { | |
| 13 | |
| 14 MockConsumer::MockConsumer() {} | |
| 15 | |
| 16 MockConsumer::~MockConsumer() {} | |
| 17 | |
| 18 // static | |
| 19 void MockConsumer::OnRetailModeSuccessQuit(const UserContext& user_context) { | |
| 20 base::MessageLoop::current()->Quit(); | |
| 21 } | |
| 22 | |
| 23 // static | |
| 24 void MockConsumer::OnRetailModeSuccessQuitAndFail( | |
| 25 const UserContext& user_context) { | |
| 26 ADD_FAILURE() << "Retail mode login should have failed!"; | |
| 27 base::MessageLoop::current()->Quit(); | |
| 28 } | |
| 29 | |
| 30 // static | |
| 31 void MockConsumer::OnGuestSuccessQuit() { | |
| 32 base::MessageLoop::current()->Quit(); | |
| 33 } | |
| 34 | |
| 35 // static | |
| 36 void MockConsumer::OnGuestSuccessQuitAndFail() { | |
| 37 ADD_FAILURE() << "Guest login should have failed!"; | |
| 38 base::MessageLoop::current()->Quit(); | |
| 39 } | |
| 40 | |
| 41 // static | |
| 42 void MockConsumer::OnSuccessQuit(const UserContext& user_context) { | |
| 43 base::MessageLoop::current()->Quit(); | |
| 44 } | |
| 45 | |
| 46 // static | |
| 47 void MockConsumer::OnSuccessQuitAndFail(const UserContext& user_context) { | |
| 48 ADD_FAILURE() << "Login should NOT have succeeded!"; | |
| 49 base::MessageLoop::current()->Quit(); | |
| 50 } | |
| 51 | |
| 52 // static | |
| 53 void MockConsumer::OnFailQuit(const LoginFailure& error) { | |
| 54 base::MessageLoop::current()->Quit(); | |
| 55 } | |
| 56 | |
| 57 // static | |
| 58 void MockConsumer::OnFailQuitAndFail(const LoginFailure& error) { | |
| 59 ADD_FAILURE() << "Login should not have failed!"; | |
| 60 base::MessageLoop::current()->Quit(); | |
| 61 } | |
| 62 | |
| 63 // static | |
| 64 void MockConsumer::OnMigrateQuit() { | |
| 65 base::MessageLoop::current()->Quit(); | |
| 66 } | |
| 67 | |
| 68 // static | |
| 69 void MockConsumer::OnMigrateQuitAndFail() { | |
| 70 ADD_FAILURE() << "Should not have detected a PW change!"; | |
| 71 base::MessageLoop::current()->Quit(); | |
| 72 } | |
| 73 | |
| 74 } // namespace chromeos | |
| OLD | NEW |