• 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_IDM_CALLBACK_H
16 #define IAM_MOCK_USER_IDM_CALLBACK_H
17 
18 #include <memory>
19 
20 #include <gmock/gmock.h>
21 #include <iremote_stub.h>
22 
23 #include "user_idm_callback_interface.h"
24 
25 namespace OHOS {
26 namespace UserIam {
27 namespace UserAuth {
28 class MockIdmGetCredentialInfoCallback final : public IRemoteStub<IdmGetCredInfoCallbackInterface> {
29 public:
30     MOCK_METHOD1(OnCredentialInfos, void(const std::vector<CredentialInfo> &credInfoList));
31     MOCK_METHOD4(OnRemoteRequest,
32         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
33 };
34 
35 class MockIdmGetSecureUserInfoCallback final : public IRemoteStub<IdmGetSecureUserInfoCallbackInterface> {
36 public:
37     MOCK_METHOD1(OnSecureUserInfo, void(const SecUserInfo &secUserInfo));
38     MOCK_METHOD4(OnRemoteRequest,
39         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
40 };
41 
42 class MockIdmCallback final : public IRemoteStub<IdmCallbackInterface> {
43 public:
44     MOCK_METHOD2(OnResult, void(int32_t result, const Attributes &extraInfo));
45     MOCK_METHOD3(OnAcquireInfo, void(int32_t module, int32_t acquire, const Attributes &extraInfo));
46     MOCK_METHOD4(OnRemoteRequest,
47         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
48 };
49 } // namespace UserAuth
50 } // namespace UserIam
51 } // namespace OHOS
52 #endif // IAM_MOCK_USER_IDM_CALLBACK_H