• 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_METHOD2(OnCredentialInfos,
31         void(const std::vector<std::shared_ptr<CredentialInfo>> infoList, const std::optional<PinSubType> pinSubType));
32     MOCK_METHOD4(OnRemoteRequest,
33         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
34 };
35 
36 class MockIdmGetSecureUserInfoCallback final : public IRemoteStub<IdmGetSecureUserInfoCallbackInterface> {
37 public:
38     MOCK_METHOD1(OnSecureUserInfo, void(const std::shared_ptr<SecureUserInfo> info));
39     MOCK_METHOD4(OnRemoteRequest,
40         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
41 };
42 
43 class MockIdmCallback final : public IRemoteStub<IdmCallbackInterface> {
44 public:
45     MOCK_METHOD2(OnResult, void(int32_t result, const Attributes &extraInfo));
46     MOCK_METHOD3(OnAcquireInfo, void(int32_t module, int32_t acquire, const Attributes &extraInfo));
47     MOCK_METHOD4(OnRemoteRequest,
48         int32_t(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option));
49 };
50 } // namespace UserAuth
51 } // namespace UserIam
52 } // namespace OHOS
53 #endif // IAM_MOCK_USER_IDM_CALLBACK_H