| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/chromeos/login/mock_login_status_consumer.h" | 5 #include "chrome/browser/chromeos/login/mock_login_status_consumer.h" | 
| 6 | 6 | 
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" | 
| 8 #include "google_apis/gaia/gaia_auth_consumer.h" | 8 #include "google_apis/gaia/gaia_auth_consumer.h" | 
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" | 
| 10 | 10 | 
| (...skipping 20 matching lines...) Expand all  Loading... | 
| 31 } | 31 } | 
| 32 | 32 | 
| 33 // static | 33 // static | 
| 34 void MockConsumer::OnGuestSuccessQuitAndFail() { | 34 void MockConsumer::OnGuestSuccessQuitAndFail() { | 
| 35   ADD_FAILURE() << "Guest login should have failed!"; | 35   ADD_FAILURE() << "Guest login should have failed!"; | 
| 36   MessageLoop::current()->Quit(); | 36   MessageLoop::current()->Quit(); | 
| 37 } | 37 } | 
| 38 | 38 | 
| 39 // static | 39 // static | 
| 40 void MockConsumer::OnSuccessQuit( | 40 void MockConsumer::OnSuccessQuit( | 
| 41     const std::string& username, | 41     const UserCredentials& credentials, | 
| 42     const std::string& password, |  | 
| 43     bool pending_requests, | 42     bool pending_requests, | 
| 44     bool using_oauth) { | 43     bool using_oauth) { | 
| 45   MessageLoop::current()->Quit(); | 44   MessageLoop::current()->Quit(); | 
| 46 } | 45 } | 
| 47 | 46 | 
| 48 // static | 47 // static | 
| 49 void MockConsumer::OnSuccessQuitAndFail( | 48 void MockConsumer::OnSuccessQuitAndFail( | 
| 50     const std::string& username, | 49     const UserCredentials& credentials, | 
| 51     const std::string& password, |  | 
| 52     bool pending_requests, | 50     bool pending_requests, | 
| 53     bool using_oauth) { | 51     bool using_oauth) { | 
| 54   ADD_FAILURE() << "Login should NOT have succeeded!"; | 52   ADD_FAILURE() << "Login should NOT have succeeded!"; | 
| 55   MessageLoop::current()->Quit(); | 53   MessageLoop::current()->Quit(); | 
| 56 } | 54 } | 
| 57 | 55 | 
| 58 // static | 56 // static | 
| 59 void MockConsumer::OnFailQuit(const LoginFailure& error) { | 57 void MockConsumer::OnFailQuit(const LoginFailure& error) { | 
| 60   MessageLoop::current()->Quit(); | 58   MessageLoop::current()->Quit(); | 
| 61 } | 59 } | 
| 62 | 60 | 
| 63 // static | 61 // static | 
| 64 void MockConsumer::OnFailQuitAndFail(const LoginFailure& error) { | 62 void MockConsumer::OnFailQuitAndFail(const LoginFailure& error) { | 
| 65   ADD_FAILURE() << "Login should not have failed!"; | 63   ADD_FAILURE() << "Login should not have failed!"; | 
| 66   MessageLoop::current()->Quit(); | 64   MessageLoop::current()->Quit(); | 
| 67 } | 65 } | 
| 68 | 66 | 
| 69 // static | 67 // static | 
| 70 void MockConsumer::OnMigrateQuit() { | 68 void MockConsumer::OnMigrateQuit() { | 
| 71   MessageLoop::current()->Quit(); | 69   MessageLoop::current()->Quit(); | 
| 72 } | 70 } | 
| 73 | 71 | 
| 74 // static | 72 // static | 
| 75 void MockConsumer::OnMigrateQuitAndFail() { | 73 void MockConsumer::OnMigrateQuitAndFail() { | 
| 76   ADD_FAILURE() << "Should not have detected a PW change!"; | 74   ADD_FAILURE() << "Should not have detected a PW change!"; | 
| 77   MessageLoop::current()->Quit(); | 75   MessageLoop::current()->Quit(); | 
| 78 } | 76 } | 
| 79 | 77 | 
| 80 }  // namespace chromeos | 78 }  // namespace chromeos | 
| OLD | NEW | 
|---|