• 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 
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         RetError(const int64_t elementId, const int32_t requestId,
32             const sptr<IAccessibilityElementOperatorCallback>& callback, const int32_t mode, bool isFilter));
33     MOCK_METHOD5(SearchDefaultFocusedByWindowId,
34         void(const int32_t windowId, const int32_t requestId,
35             const sptr<IAccessibilityElementOperatorCallback>& callback, const int32_t mode, bool isFilter));
36     MOCK_METHOD4(
37         SearchElementInfosByText, void(const int64_t elementId, const std::string& text, const int32_t requestId,
38                                       const sptr<IAccessibilityElementOperatorCallback>& callback));
39     MOCK_METHOD4(FindFocusedElementInfo, void(const int64_t elementId, const int32_t focusType, const int32_t requestId,
40                                              const sptr<IAccessibilityElementOperatorCallback>& callback));
41     MOCK_METHOD4(FocusMoveSearch, void(const int64_t elementId, const int32_t direction, const int32_t requestId,
42                                       const sptr<IAccessibilityElementOperatorCallback>& callback));
43     MOCK_METHOD5(ExecuteAction,
44         void(const int64_t elementId, const int32_t action, const std::map<std::string, std::string> &actionArguments,
45             const int32_t requestId, const sptr<IAccessibilityElementOperatorCallback>& callback));
46     MOCK_METHOD3(GetCursorPosition,
47         void(const int64_t elementId, const int32_t requestId,
48         const sptr<IAccessibilityElementOperatorCallback>& callback));
49     MOCK_METHOD4(SearchElementInfoBySpecificProperty, void(const int64_t elementId,
50         const SpecificPropertyParam& param, const int32_t requestId,
51         const sptr<IAccessibilityElementOperatorCallback>& callback));
52     MOCK_METHOD0(ClearFocus, void());
53     MOCK_METHOD0(OutsideTouch, void());
54     MOCK_METHOD1(SetWindowId, void(int32_t windowId));
55     MOCK_METHOD0(GetWindowId, int32_t());
56     MOCK_METHOD3(SetChildTreeIdAndWinId, void(const int64_t elementId, const int32_t treeId,
57         const int32_t childWindowId));
58     MOCK_METHOD1(SetBelongTreeId, void(const int32_t treeId));
59     MOCK_METHOD1(SetParentWindowId, void(const int32_t parentWindowId));
60 };
61 } // namespace Accessibility
62 } // namespace OHOS
63 #endif // MOCK_ACCESSIBILITY_ELEMENT_OPERATOR_STUB_H