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 #ifndef CHROMEOS_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_
6 #define CHROMEOS_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_
8 #include "chromeos/chromeos_export.h"
9 #include "chromeos/login/auth/auth_status_consumer.h"
10 #include "chromeos/login/auth/user_context.h"
11 #include "testing/gmock/include/gmock/gmock.h"
15 class CHROMEOS_EXPORT MockAuthStatusConsumer
: public AuthStatusConsumer
{
17 MockAuthStatusConsumer();
18 virtual ~MockAuthStatusConsumer();
20 MOCK_METHOD1(OnAuthFailure
, void(const AuthFailure
& error
));
21 MOCK_METHOD1(OnRetailModeAuthSuccess
, void(const UserContext
& user_context
));
22 MOCK_METHOD1(OnAuthSuccess
, void(const UserContext
& user_context
));
23 MOCK_METHOD0(OnOffTheRecordAuthSuccess
, void(void));
24 MOCK_METHOD0(OnPasswordChangeDetected
, void(void));
26 // The following functions can be used in gmock Invoke() clauses.
28 // Compatible with AuthStatusConsumer::OnRetailModeAuthSuccess()
29 static void OnRetailModeSuccessQuit(const UserContext
& user_context
);
30 static void OnRetailModeSuccessQuitAndFail(const UserContext
& user_context
);
32 // Compatible with AuthStatusConsumer::OnOffTheRecordAuthSuccess()
33 static void OnGuestSuccessQuit();
34 static void OnGuestSuccessQuitAndFail();
36 // Compatible with AuthStatusConsumer::OnAuthSuccess()
37 static void OnSuccessQuit(const UserContext
& user_context
);
38 static void OnSuccessQuitAndFail(const UserContext
& user_context
);
40 // Compatible with AuthStatusConsumer::OnAuthFailure()
41 static void OnFailQuit(const AuthFailure
& error
);
42 static void OnFailQuitAndFail(const AuthFailure
& error
);
44 // Compatible with AuthStatusConsumer::OnPasswordChangeDetected()
45 static void OnMigrateQuit();
46 static void OnMigrateQuitAndFail();
49 } // namespace chromeos
51 #endif // CHROMEOS_LOGIN_AUTH_MOCK_AUTH_STATUS_CONSUMER_H_