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