1 /* 2 * Copyright (C) 2021 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_ACCESSIBLE_ABILITY_CHANNEL_STUB_H 17 #define MOCK_ACCESSIBLE_ABILITY_CHANNEL_STUB_H 18 19 #include "accessible_ability_channel_stub.h" 20 #include "gmock/gmock.h" 21 22 namespace OHOS { 23 namespace Accessibility { 24 class MockAccessibleAbilityChannelStub : public AccessibleAbilityChannelStub { 25 public: 26 MockAccessibleAbilityChannelStub(); 27 virtual ~MockAccessibleAbilityChannelStub(); 28 29 MOCK_METHOD4(OnRemoteRequest, int(uint32_t code, MessageParcel& data, 30 MessageParcel& reply, MessageOption& option)); 31 MOCK_METHOD6( 32 SearchElementInfoByAccessibilityId, RetError(const ElementBasicInfo elementBasicInfo, const int32_t requestId, 33 const sptr<IAccessibilityElementOperatorCallback>& callback, 34 const int32_t mode, bool isFilter, bool systemApi)); 35 MOCK_METHOD5(SearchDefaultFocusedByWindowId, 36 RetError(const ElementBasicInfo elementBasicInfo, const int32_t requestId, 37 const sptr<IAccessibilityElementOperatorCallback>& callback, const int32_t mode, bool isFilter)); 38 MOCK_METHOD6(SearchElementInfosByText, 39 RetError(const int32_t accessibilityWindowId, const int64_t elementId, const std::string& text, 40 const int32_t requestId, const sptr<IAccessibilityElementOperatorCallback>& callback, bool systemApi)); 41 MOCK_METHOD6(FindFocusedElementInfo, 42 RetError(const int32_t accessibilityWindowId, const int64_t elementId, const int32_t focusType, 43 const int32_t requestId, const sptr<IAccessibilityElementOperatorCallback>& callback, bool systemApi)); 44 MOCK_METHOD6(FocusMoveSearch, RetError(const int32_t accessibilityWindowId, const int64_t elementId, 45 const int32_t direction, const int32_t requestId, 46 const sptr<IAccessibilityElementOperatorCallback>& callback, bool systemApi)); 47 MOCK_METHOD6(ExecuteAction, RetError(const int32_t accessibilityWindowId, const int64_t elementId, 48 const int32_t action, const std::map<std::string, std::string>& actionArguments, const int32_t requestId, 49 const sptr<IAccessibilityElementOperatorCallback>& callback)); 50 MOCK_METHOD1(EnableScreenCurtain, RetError(bool isEnable)); 51 MOCK_METHOD0(HoldRunningLock, RetError()); 52 MOCK_METHOD0(UnholdRunningLock, RetError()); 53 MOCK_METHOD4(GetCursorPosition, RetError(const int32_t accessibilityWindowId, const int64_t elementId, 54 const int32_t requestId, const sptr<IAccessibilityElementOperatorCallback>& callback)); 55 MOCK_METHOD2(GetWindow, RetError(const int32_t windowId, AccessibilityWindowInfo &windowInfo)); 56 MOCK_METHOD2(GetWindows, RetError(std::vector<AccessibilityWindowInfo> &windows, bool systemApi)); 57 MOCK_METHOD3(GetWindowsByDisplayId, RetError(const uint64_t displayId, 58 std::vector<AccessibilityWindowInfo> &windows, bool systemApi)); 59 MOCK_METHOD2(SetOnKeyPressEventResult, void(const bool handled, const int32_t sequence)); 60 MOCK_METHOD1(SendSimulateGesture, RetError(const std::shared_ptr<AccessibilityGestureInjectPath>& gesturePath)); 61 MOCK_METHOD1(SetTargetBundleName, RetError(const std::vector<std::string> &targetBundleNames)); 62 MOCK_METHOD1(SetIsRegisterDisconnectCallback, RetError(bool isRegister)); 63 MOCK_METHOD0(NotifyDisconnect, RetError()); 64 MOCK_METHOD1(ConfigureEvents, RetError(const std::vector<uint32_t> needEvents)); 65 MOCK_METHOD4(SearchElementInfoBySpecificProperty, void(const ElementBasicInfo elementBasicInfo, 66 const SpecificPropertyParam& param, const int32_t requestId, 67 const sptr<IAccessibilityElementOperatorCallback>& callback)); 68 }; 69 } // namespace Accessibility 70 } // namespace OHOS 71 #endif // MOCK_ACCESSIBLE_ABILITY_CHANNEL_STUB_H