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_METHOD5(DispatchSurfaceChangeEvent, void(float width, float height, uint32_t reason, 29 const std::shared_ptr<Rosen::RSTransaction>& rsTransaction, float borderWidth)); 30 MOCK_METHOD1(SetObscured, void(bool isObscured)); 31 MOCK_METHOD3(OnAccessibilityChildTreeRegister, void(uint32_t windowId, int32_t treeId, int64_t accessibilityId)); 32 MOCK_METHOD0(OnAccessibilityChildTreeDeregister, void()); 33 MOCK_METHOD2( 34 OnAccessibilityDumpChildInfo, void(const std::vector<std::string>& params, std::vector<std::string>& info)); 35 MOCK_METHOD5(OnAccessibilityTransferHoverEvent, 36 void(float pointX, float pointY, int32_t sourceType, int32_t eventType, int64_t timeMs)); 37 MOCK_METHOD2( 38 OnNotifyDumpInfo, void(const std::vector<std::string>& params, std::vector<std::string>& info)); SendRequest(uint32_t code,MessageParcel & data,MessageParcel & reply,MessageOption & option)39 int SendRequest(uint32_t code, MessageParcel& data, MessageParcel& reply, MessageOption& option) 40 { 41 SendRequest_called = true; 42 return 0; 43 } 44 bool SendRequest_called = false; 45 }; 46 } // namespace AppExecFwk 47 } // namespace OHOS 48 #endif // MOCK_FROM_RENDERER_DISPATCHER_STUB_H