1 /* 2 * Copyright (c) 2024 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_FROM_RENDERER_DISPATCHER_STUB_H 17 #define MOCK_FROM_RENDERER_DISPATCHER_STUB_H 18 #include <gmock/gmock.h> 19 #include "form_renderer_dispatcher_stub.h" 20 21 namespace OHOS { 22 namespace AppExecFwk { 23 class MockFormRendererDispatherStub : public Ace::FormRendererDispatcherStub { 24 public: 25 MOCK_METHOD2(DispatchPointerEvent, 26 void(const std::shared_ptr<OHOS::MMI::PointerEvent>& pointerEvent, Ace::SerializedGesture& serializedGesture)); 27 MOCK_METHOD1(SetAllowUpdate, void(bool allowUpdate)); 28 MOCK_METHOD3(DispatchSurfaceChangeEvent, void(float width, float height, float borderWidth)); 29 MOCK_METHOD1(SetObscured, void(bool isObscured)); 30 MOCK_METHOD3(OnAccessibilityChildTreeRegister, void(uint32_t windowId, int32_t treeId, int64_t accessibilityId)); 31 MOCK_METHOD0(OnAccessibilityChildTreeDeregister, void()); 32 MOCK_METHOD2( 33 OnAccessibilityDumpChildInfo, void(const std::vector<std::string>& params, std::vector<std::string>& info)); 34 MOCK_METHOD5(OnAccessibilityTransferHoverEvent, 35 void(float pointX, float pointY, int32_t sourceType, int32_t eventType, int64_t timeMs)); SendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)36 int SendRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) 37 { 38 SendRequest_called = true; 39 return 0; 40 } 41 bool SendRequest_called = false; 42 }; 43 } // namespace AppExecFwk 44 } // namespace OHOS 45 #endif // MOCK_FROM_RENDERER_DISPATCHER_STUB_H