• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 OHOS_ROSEN_MOCK_SCENE_SESSION_MANAGER_STUB_H
17 #define OHOS_ROSEN_MOCK_SCENE_SESSION_MANAGER_STUB_H
18 
19 #include "zidl/scene_session_manager_stub.h"
20 #include <gmock/gmock.h>
21 
22 namespace OHOS::Rosen {
23 class MockSceneSessionManagerStub : public SceneSessionManagerStub {
24 public:
25     MOCK_METHOD(WSError, SetSessionLabel, (const sptr<IRemoteObject>& token, const std::string& label), (override));
26     MOCK_METHOD(WSError, SetSessionIcon, (const sptr<IRemoteObject>& token,
27         const std::shared_ptr<Media::PixelMap>& icon), (override));
28     MOCK_METHOD(WSError, IsValidSessionIds, (const std::vector<int32_t>& sessionIds, std::vector<bool>& results),
29         (override));
30     MOCK_METHOD(WSError, PendingSessionToForeground, (const sptr<IRemoteObject>& token),
31         (override));
32     MOCK_METHOD(WSError, PendingSessionToBackgroundForDelegator, (const sptr<IRemoteObject>& token,
33         bool shouldBackToCaller), (override));
34     MOCK_METHOD(WSError, GetFocusSessionToken, (sptr<IRemoteObject>& token, DisplayId displayId), (override));
35     MOCK_METHOD(WSError, GetFocusSessionElement, (AppExecFwk::ElementName& element, DisplayId displayId), (override));
36     MOCK_METHOD(WSError, RegisterSessionListener, (const sptr<ISessionListener>& listener), (override));
37     MOCK_METHOD(WSError, UnRegisterSessionListener, (const sptr<ISessionListener>& listener), (override));
38     MOCK_METHOD(WSError, GetSessionInfos, (const std::string& deviceId, int32_t numMax,
39         std::vector<SessionInfoBean>& sessionInfos), (override));
40     MOCK_METHOD(WSError, GetSessionInfo, (const std::string& deviceId, int32_t persistentId,
41         SessionInfoBean& sessionInfo), (override));
42     MOCK_METHOD(WSError, GetSessionInfoByContinueSessionId, (const std::string& continueSessionId,
43         SessionInfoBean& sessionInfo), (override));
44     MOCK_METHOD(WSError, SetSessionContinueState, (const sptr<IRemoteObject>& token,
45         const ContinueState& continueState), (override));
46     MOCK_METHOD(WSError, TerminateSessionNew, (const sptr<AAFwk::SessionInfo> info,
47         bool needStartCaller, bool isFromBroker), (override));
48     MOCK_METHOD(WSError, GetSessionDumpInfo, (const std::vector<std::string>& params, std::string& info), (override));
49     MOCK_METHOD(WSError, GetSessionSnapshot, (const std::string& deviceId,
50         int32_t persistentId, SessionSnapshot& snapshot, bool isLowResolution), (override));
51     MOCK_METHOD(WSError, ClearSession, (int32_t persistentId), (override));
52     MOCK_METHOD(WSError, ClearAllSessions, (), (override));
53     MOCK_METHOD(WSError, LockSession, (int32_t sessionId), (override));
54     MOCK_METHOD(WSError, UnlockSession, (int32_t sessionId), (override));
55     MOCK_METHOD(WSError, MoveSessionsToForeground,
56         (const std::vector<std::int32_t>& sessionIds, int32_t topSessionId), (override));
57     MOCK_METHOD(WSError, MoveSessionsToBackground,
58         (const std::vector<std::int32_t>& sessionIds, std::vector<std::int32_t>& result), (override));
59     MOCK_METHOD(WSError, RegisterIAbilityManagerCollaborator,
60         (int32_t type, const sptr<AAFwk::IAbilityManagerCollaborator>& impl), (override));
61     MOCK_METHOD(WSError, UnregisterIAbilityManagerCollaborator, (int32_t type), (override));
62     MOCK_METHOD(WMError, GetProcessSurfaceNodeIdByPersistentId, (const int32_t pid,
63         const std::vector<int32_t>& persistentIds, std::vector<uint64_t>& surfaceNodeIds), (override));
64     MOCK_METHOD(WMError, SkipSnapshotByUserIdAndBundleNames,
65         (int32_t userId, const std::vector<std::string>& bundleNameList), (override));
66 
67     // IWindowManager overrides
68     MOCK_METHOD(WMError, CreateWindow, (sptr<IWindow>& window, sptr<WindowProperty>& property,
69         const std::shared_ptr<RSSurfaceNode>& surfaceNode, uint32_t& windowId, sptr<IRemoteObject> token), (override));
70     MOCK_METHOD(WMError, AddWindow, (sptr<WindowProperty>& property), (override));
71     MOCK_METHOD(WMError, RemoveWindow, (uint32_t windowId, bool isFromInnerkits), (override));
72     MOCK_METHOD(WMError, DestroyWindow, (uint32_t windowId, bool onlySelf), (override));
73     MOCK_METHOD(WMError, RequestFocus, (uint32_t windowId), (override));
74     MOCK_METHOD(WMError, GetTopWindowId, (uint32_t mainWinId, uint32_t& topWinId), (override));
75     MOCK_METHOD(WMError, GetParentMainWindowId, (int32_t windowId, int32_t& mainWindowId), (override));
76     MOCK_METHOD(WMError, UpdateProperty,
77         (sptr<WindowProperty>& windowProperty, PropertyChangeAction action, bool isAsyncTask), (override));
78     MOCK_METHOD(WMError, RaiseToAppTop, (uint32_t windowId), (override));
79     MOCK_METHOD(WMError, MinimizeByWindowId, (const std::vector<int32_t>& windowIds), (override));
80     MOCK_METHOD(WSError, ShiftAppWindowFocus, (int32_t sourcePersistentId, int32_t targetPersistentId), (override));
81     MOCK_METHOD(WSError, GetHostWindowRect, (int32_t hostWindowId, Rect& rect), (override));
82     MOCK_METHOD(WMError, GetWindowModeType, (WindowModeType& windowModeType), (override));
83     MOCK_METHOD(WMError, GetWindowIdsByCoordinate,
84         (DisplayId displayId, int32_t windowNumber, int32_t x, int32_t y, std::vector<int32_t>& windowIds), (override));
85     MOCK_METHOD(WMError, SetGlobalDragResizeType, (DragResizeType dragResizeType), (override));
86     MOCK_METHOD(WMError, GetGlobalDragResizeType, (DragResizeType& dragResizeType), (override));
87     MOCK_METHOD(WMError, SetAppDragResizeType,
88         (const std::string& bundleName, DragResizeType dragResizeType), (override));
89     MOCK_METHOD(WMError, ShiftAppWindowPointerEvent,
90         (int32_t sourcePersistentId, int32_t targetPersistentId, int32_t fingerId), (override));
91     MOCK_METHOD(WMError, SetStartWindowBackgroundColor, (const std::string& moduleName,
92         const std::string& abilityName, uint32_t color, int32_t uid), (override));
93     MOCK_METHOD(WSError, UseImplicitAnimation, (int32_t hostWindowId, bool useImplicit), (override));
94     MOCK_METHOD(WMError, CreateUIEffectController, (const sptr<IUIEffectControllerClient>& controllerClient,
95         sptr<IUIEffectController>& controller, int32_t& controllerId), (override));
96     MOCK_METHOD(WMError, AddSessionBlackList, (const std::unordered_set<std::string>& bundleNames,
97         const std::unordered_set<std::string>& privacyWindowTags), (override));
98     MOCK_METHOD(WMError, RemoveSessionBlackList, (const std::unordered_set<std::string>& bundleNames,
99         const std::unordered_set<std::string>& privacyWindowTags), (override));
100     MOCK_METHOD(WMError, GetPiPSettingSwitchStatus, (bool& switchStatus), (override));
101 };
102 } // namespace OHOS::Rosen
103 #endif // OHOS_ROSEN_MOCK_SCENE_SESSION_MANAGER_STUB_H