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 
16 #ifndef MOCK_ACCESSIBILITY_ELEMENT_OPERATOR_STUB_H
17 #define MOCK_ACCESSIBILITY_ELEMENT_OPERATOR_STUB_H
18 
19 #include <gmock/gmock.h>
20 #include "accessibility_element_operator_stub.h"
21 
22 namespace OHOS {
23 namespace Accessibility {
24 class MockAccessibilityElementOperatorStub : public AccessibilityElementOperatorStub {
25 public:
26     MockAccessibilityElementOperatorStub() = default;
27     virtual ~MockAccessibilityElementOperatorStub() = default;
28 
29     MOCK_METHOD4(OnRemoteRequest, int(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option));
30     MOCK_METHOD5(SearchElementInfoByAccessibilityId,
31         void(const int64_t elementId, const int32_t requestId,
32             const sptr<IAccessibilityElementOperatorCallback>& callback, const int32_t mode, bool isFilter));
33     MOCK_METHOD4(
34         SearchElementInfosByText, void(const int64_t elementId, const std::string& text, const int32_t requestId,
35                                       const sptr<IAccessibilityElementOperatorCallback>& callback));
36     MOCK_METHOD4(FindFocusedElementInfo, void(const int64_t elementId, const int32_t focusType, const int32_t requestId,
37                                              const sptr<IAccessibilityElementOperatorCallback>& callback));
38     MOCK_METHOD4(FocusMoveSearch, void(const int64_t elementId, const int32_t direction, const int32_t requestId,
39                                       const sptr<IAccessibilityElementOperatorCallback>& callback));
40     MOCK_METHOD5(ExecuteAction,
41         void(const int64_t elementId, const int32_t action, const std::map<std::string, std::string> &actionArguments,
42             const int32_t requestId, const sptr<IAccessibilityElementOperatorCallback>& callback));
43     MOCK_METHOD3(GetCursorPosition,
44         void(const int64_t elementId, const int32_t requestId,
45         const sptr<IAccessibilityElementOperatorCallback>& callback));
46     MOCK_METHOD0(ClearFocus, void());
47     MOCK_METHOD0(OutsideTouch, void());
48     MOCK_METHOD1(SetWindowId, void(int32_t windowId));
49     MOCK_METHOD0(GetWindowId, int32_t());
50     MOCK_METHOD3(SetChildTreeIdAndWinId, void(const int64_t elementId, const int32_t treeId,
51         const int32_t childWindowId));
52     MOCK_METHOD1(SetBelongTreeId, void(const int32_t treeId));
53     MOCK_METHOD1(SetParentWindowId, void(const int32_t parentWindowId));
54 };
55 } // namespace Accessibility
56 } // namespace OHOS
57 #endif // MOCK_ACCESSIBILITY_ELEMENT_OPERATOR_STUB_H