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 17 #include "iremote_broker.h" 18 #include "window.h" 19 #include "zidl/window_interface.h" 20 #include "window_property.h" 21 #include "wm_common.h" 22 #include "wm_common_inner.h" 23 #include <gmock/gmock.h> 24 25 namespace OHOS { 26 namespace Rosen { 27 class IWindowMocker : public IWindow { 28 public: IWindowMocker()29 IWindowMocker() {}; ~IWindowMocker()30 ~IWindowMocker() {}; 31 MOCK_METHOD4(UpdateWindowRect, WMError(const struct Rect& rect, bool decoStatus, WindowSizeChangeReason reason, 32 const std::shared_ptr<RSTransaction>& rsTransaction)); 33 MOCK_METHOD1(UpdateWindowMode, WMError(WindowMode mode)); 34 MOCK_METHOD1(UpdateWindowModeSupportType, WMError(uint32_t windowModeSupportType)); 35 MOCK_METHOD1(UpdateFocusStatus, WMError(bool focused)); 36 MOCK_METHOD2(UpdateAvoidArea, WMError(const sptr<AvoidArea>& avoidArea, AvoidAreaType type)); 37 MOCK_METHOD1(UpdateWindowState, WMError(WindowState state)); 38 MOCK_METHOD2(UpdateWindowDragInfo, WMError(const PointInfo& point, DragEvent event)); 39 MOCK_METHOD2(UpdateDisplayId, WMError(DisplayId from, DisplayId to)); 40 MOCK_METHOD2(UpdateOccupiedAreaChangeInfo, WMError(const sptr<OccupiedAreaChangeInfo>& info, 41 const std::shared_ptr<RSTransaction>& rsTransaction)); 42 MOCK_METHOD3(UpdateOccupiedAreaAndRect, WMError(const sptr<OccupiedAreaChangeInfo>& info, 43 const Rect& rect, const std::shared_ptr<RSTransaction>& rsTransaction)); 44 MOCK_METHOD1(UpdateActiveStatus, WMError(bool isActive)); 45 MOCK_METHOD0(GetWindowProperty, sptr<WindowProperty>()); 46 MOCK_METHOD0(NotifyTouchOutside, WMError()); 47 MOCK_METHOD0(NotifyScreenshot, WMError()); 48 MOCK_METHOD1(DumpInfo, WMError(const std::vector<std::string>& params)); 49 MOCK_METHOD0(NotifyDestroy, WMError(void)); 50 MOCK_METHOD0(NotifyForeground, WMError(void)); 51 MOCK_METHOD0(NotifyBackground, WMError(void)); 52 MOCK_METHOD1(NotifyWindowClientPointUp, WMError(const std::shared_ptr<MMI::PointerEvent>& pointerEvent)); 53 MOCK_METHOD2(UpdateZoomTransform, WMError(const Transform& trans, bool isDisplayZoomOn)); 54 MOCK_METHOD1(RestoreSplitWindowMode, WMError(uint32_t mode)); 55 MOCK_METHOD1(ConsumeKeyEvent, void(std::shared_ptr<MMI::KeyEvent> event)); 56 MOCK_METHOD1(NotifyForegroundInteractiveStatus, void(bool interactive)); AsObject()57 sptr<IRemoteObject> AsObject() override 58 { 59 return nullptr; 60 }; 61 }; 62 } // namespace Rosen 63 } // namespace OHOS 64