• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef IAM_MOCK_USER_AUTH_CALLBACK_H
16 #define IAM_MOCK_USER_AUTH_CALLBACK_H
17 
18 #include <gmock/gmock.h>
19 #include <iremote_stub.h>
20 
21 #include "iiam_callback.h"
22 #include "iget_executor_property_callback.h"
23 #include "iset_executor_property_callback.h"
24 
25 namespace OHOS {
26 namespace UserIam {
27 namespace UserAuth {
28 class MockUserAuthCallback final : public IRemoteStub<IIamCallback> {
29 public:
30     MOCK_METHOD4(OnRemoteRequest,
31         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
32     MOCK_METHOD2(OnResult, int32_t(int32_t resultCode, const std::vector<uint8_t> &extraInfo));
33     MOCK_METHOD3(OnAcquireInfo, int32_t(int32_t module, int32_t acquireInfo, const std::vector<uint8_t> &extraInfo));
34     MOCK_METHOD1(CallbackEnter, int32_t(uint32_t code));
35     MOCK_METHOD2(CallbackExit, int32_t(uint32_t code, int32_t result));
36 };
37 
38 class MockGetExecutorPropertyCallback final : public IRemoteStub<IGetExecutorPropertyCallback> {
39 public:
40     MOCK_METHOD4(OnRemoteRequest,
41         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
42     MOCK_METHOD2(OnGetExecutorPropertyResult, int32_t(int32_t resultCode, const std::vector<uint8_t> &attributes));
43     MOCK_METHOD1(CallbackEnter, int32_t(uint32_t code));
44     MOCK_METHOD2(CallbackExit, int32_t(uint32_t code, int32_t result));
45 };
46 
47 class MockSetExecutorPropertyCallback final : public IRemoteStub<ISetExecutorPropertyCallback> {
48 public:
49     MOCK_METHOD4(OnRemoteRequest,
50         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
51     MOCK_METHOD1(OnSetExecutorPropertyResult, int32_t(int32_t result));
52     MOCK_METHOD1(CallbackEnter, int32_t(uint32_t code));
53     MOCK_METHOD2(CallbackExit, int32_t(uint32_t code, int32_t result));
54 };
55 } // namespace UserAuth
56 } // namespace UserIam
57 } // namespace OHOS
58 #endif // IAM_MOCK_USER_AUTH_CALLBACK_H