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