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.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_LOGIN_STATUS_CONSUMER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_LOGIN_STATUS_CONSUMER_H_
8 #include "chrome/browser/chromeos/login/login_status_consumer.h"
9 #include "chrome/browser/chromeos/login/user.h"
10 #include "testing/gmock/include/gmock/gmock.h"
14 class MockConsumer
: public LoginStatusConsumer
{
17 virtual ~MockConsumer();
19 MOCK_METHOD1(OnLoginFailure
, void(const LoginFailure
& error
));
20 MOCK_METHOD1(OnRetailModeLoginSuccess
, void(
21 const UserContext
& user_context
));
22 MOCK_METHOD1(OnLoginSuccess
, void(const UserContext
& user_context
));
23 MOCK_METHOD0(OnOffTheRecordLoginSuccess
, void(void));
24 MOCK_METHOD0(OnPasswordChangeDetected
, void(void));
26 // The following functions can be used in gmock Invoke() clauses.
28 // Compatible with LoginStatusConsumer::OnRetailModeLoginSuccess()
29 static void OnRetailModeSuccessQuit(const UserContext
& user_context
);
30 static void OnRetailModeSuccessQuitAndFail(
31 const UserContext
& user_context
);
33 // Compatible with LoginStatusConsumer::OnOffTheRecordLoginSuccess()
34 static void OnGuestSuccessQuit();
35 static void OnGuestSuccessQuitAndFail();
37 // Compatible with LoginStatusConsumer::OnLoginSuccess()
38 static void OnSuccessQuit(const UserContext
& user_context
);
39 static void OnSuccessQuitAndFail(const UserContext
& user_context
);
41 // Compatible with LoginStatusConsumer::OnLoginFailure()
42 static void OnFailQuit(const LoginFailure
& error
);
43 static void OnFailQuitAndFail(const LoginFailure
& error
);
45 // Compatible with LoginStatusConsumer::OnPasswordChangeDetected()
46 static void OnMigrateQuit();
47 static void OnMigrateQuitAndFail();
50 } // namespace chromeos
52 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_MOCK_LOGIN_STATUS_CONSUMER_H_