• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 <gtest/gtest.h>
17 #include <ipc_types.h>
18 
19 #include "session_manager/include/zidl/scene_session_manager_lite_stub.h"
20 
21 using namespace testing;
22 using namespace testing::ext;
23 
24 namespace OHOS {
25 namespace Rosen {
26 class MockSceneSessionManagerLiteStub : public SceneSessionManagerLiteStub {
SetSessionLabel(const sptr<IRemoteObject> & token,const std::string & label)27     WSError SetSessionLabel(const sptr<IRemoteObject>& token, const std::string& label) override
28     {
29         return WSError::WS_OK;
30     }
SetSessionIcon(const sptr<IRemoteObject> & token,const std::shared_ptr<Media::PixelMap> & icon)31     WSError SetSessionIcon(const sptr<IRemoteObject>& token, const std::shared_ptr<Media::PixelMap>& icon) override
32     {
33         return WSError::WS_OK;
34     }
IsValidSessionIds(const std::vector<int32_t> & sessionIds,std::vector<bool> & results)35     WSError IsValidSessionIds(const std::vector<int32_t>& sessionIds, std::vector<bool>& results) override
36     {
37         return WSError::WS_OK;
38     }
PendingSessionToForeground(const sptr<IRemoteObject> & token)39     WSError PendingSessionToForeground(const sptr<IRemoteObject>& token) override
40     {
41         return WSError::WS_OK;
42     }
PendingSessionToBackgroundForDelegator(const sptr<IRemoteObject> & token,bool shouldBackToCaller)43     WSError PendingSessionToBackgroundForDelegator(const sptr<IRemoteObject>& token, bool shouldBackToCaller) override
44     {
45         return WSError::WS_OK;
46     }
GetFocusSessionToken(sptr<IRemoteObject> & token,DisplayId displayId)47     WSError GetFocusSessionToken(sptr<IRemoteObject>& token, DisplayId displayId) override
48     {
49         return WSError::WS_OK;
50     }
GetFocusSessionElement(AppExecFwk::ElementName & element,DisplayId displayId)51     WSError GetFocusSessionElement(AppExecFwk::ElementName& element, DisplayId displayId) override
52     {
53         return WSError::WS_OK;
54     }
RegisterSessionListener(const sptr<ISessionListener> & listener,bool isRecover=false)55     WSError RegisterSessionListener(const sptr<ISessionListener>& listener, bool isRecover = false) override
56     {
57         return WSError::WS_OK;
58     }
UnRegisterSessionListener(const sptr<ISessionListener> & listener)59     WSError UnRegisterSessionListener(const sptr<ISessionListener>& listener) override
60     {
61         return WSError::WS_OK;
62     }
GetSessionInfos(const std::string & deviceId,int32_t numMax,std::vector<SessionInfoBean> & sessionInfos)63     WSError GetSessionInfos(const std::string& deviceId,
64         int32_t numMax, std::vector<SessionInfoBean>& sessionInfos) override
65     {
66         return WSError::WS_OK;
67     }
GetMainWindowStatesByPid(int32_t pid,std::vector<MainWindowState> & windowStates)68     WSError GetMainWindowStatesByPid(int32_t pid, std::vector<MainWindowState>& windowStates) override
69     {
70         return WSError::WS_OK;
71     }
GetSessionInfo(const std::string & deviceId,int32_t persistentId,SessionInfoBean & sessionInfo)72     WSError GetSessionInfo(const std::string& deviceId, int32_t persistentId, SessionInfoBean& sessionInfo) override
73     {
74         return WSError::WS_OK;
75     }
GetSessionInfoByContinueSessionId(const std::string & continueSessionId,SessionInfoBean & sessionInfo)76     WSError GetSessionInfoByContinueSessionId(const std::string& continueSessionId,
77         SessionInfoBean& sessionInfo) override
78     {
79         return WSError::WS_OK;
80     }
SetSessionContinueState(const sptr<IRemoteObject> & token,const ContinueState & continueState)81     WSError SetSessionContinueState(const sptr<IRemoteObject>& token, const ContinueState& continueState) override
82     {
83         return WSError::WS_OK;
84     }
TerminateSessionNew(const sptr<AAFwk::SessionInfo> info,bool needStartCaller,bool isFromBroker=false)85     WSError TerminateSessionNew(
86         const sptr<AAFwk::SessionInfo> info, bool needStartCaller, bool isFromBroker = false) override
87     {
88         return WSError::WS_OK;
89     }
GetSessionSnapshot(const std::string & deviceId,int32_t persistentId,SessionSnapshot & snapshot,bool isLowResolution)90     WSError GetSessionSnapshot(const std::string& deviceId, int32_t persistentId,
91         SessionSnapshot& snapshot, bool isLowResolution) override
92     {
93         return WSError::WS_OK;
94     }
ClearSession(int32_t persistentId)95     WSError ClearSession(int32_t persistentId) override
96     {
97         return WSError::WS_OK;
98     }
ClearAllSessions()99     WSError ClearAllSessions() override
100     {
101         return WSError::WS_OK;
102     }
LockSession(int32_t sessionId)103     WSError LockSession(int32_t sessionId) override
104     {
105         return WSError::WS_OK;
106     }
UnlockSession(int32_t sessionId)107     WSError UnlockSession(int32_t sessionId) override
108     {
109         return WSError::WS_OK;
110     }
MoveSessionsToForeground(const std::vector<std::int32_t> & sessionIds,int32_t topSessionId)111     WSError MoveSessionsToForeground(const std::vector<std::int32_t>& sessionIds, int32_t topSessionId) override
112     {
113         return WSError::WS_OK;
114     }
MoveSessionsToBackground(const std::vector<std::int32_t> & sessionIds,std::vector<std::int32_t> & result)115     WSError MoveSessionsToBackground(const std::vector<std::int32_t>& sessionIds,
116         std::vector<std::int32_t>& result) override
117     {
118         return WSError::WS_OK;
119     }
RegisterWindowManagerAgent(WindowManagerAgentType type,const sptr<IWindowManagerAgent> & windowManagerAgent)120     WMError RegisterWindowManagerAgent(WindowManagerAgentType type,
121         const sptr<IWindowManagerAgent>& windowManagerAgent) override
122     {
123         return WMError::WM_OK;
124     }
UnregisterWindowManagerAgent(WindowManagerAgentType type,const sptr<IWindowManagerAgent> & windowManagerAgent)125     WMError UnregisterWindowManagerAgent(WindowManagerAgentType type,
126         const sptr<IWindowManagerAgent>& windowManagerAgent) override
127     {
128         return WMError::WM_OK;
129     }
ListWindowInfo(const WindowInfoOption & windowInfoOption,std::vector<sptr<WindowInfo>> & infos)130     WMError ListWindowInfo(const WindowInfoOption& windowInfoOption,
131         std::vector<sptr<WindowInfo>>& infos) override
132     {
133         return WMError::WM_OK;
134     }
GetFocusWindowInfo(FocusChangeInfo & focusInfo,DisplayId displayId)135     void GetFocusWindowInfo(FocusChangeInfo& focusInfo, DisplayId displayId) override
136     {
137     }
CheckWindowId(int32_t windowId,int32_t & pid)138     WMError CheckWindowId(int32_t windowId, int32_t& pid) override
139     {
140         return WMError::WM_OK;
141     }
GetMainWindowInfos(int32_t topNum,std::vector<MainWindowInfo> & topNInfo)142     WMError GetMainWindowInfos(int32_t topNum, std::vector<MainWindowInfo>& topNInfo) override
143     {
144         MainWindowInfo mainWindowInfo;
145         topNInfo.push_back(mainWindowInfo);
146         return WMError::WM_OK;
147     }
GetAllMainWindowInfos(std::vector<MainWindowInfo> & infos)148     WMError GetAllMainWindowInfos(std::vector<MainWindowInfo>& infos) override
149     {
150         MainWindowInfo mainWindowInfo;
151         infos.push_back(mainWindowInfo);
152         return WMError::WM_OK;
153     }
GetCallingWindowInfo(CallingWindowInfo & callingWindowInfo)154     WMError GetCallingWindowInfo(CallingWindowInfo& callingWindowInfo) override
155     {
156         return WMError::WM_OK;
157     }
ClearMainSessions(const std::vector<int32_t> & persistentIds,std::vector<int32_t> & clearFailedIds)158     WMError ClearMainSessions(const std::vector<int32_t>& persistentIds,
159         std::vector<int32_t>& clearFailedIds) override
160     {
161         clearFailedIds.push_back(1);
162         return WMError::WM_OK;
163     }
RaiseWindowToTop(int32_t persistentId)164     WSError RaiseWindowToTop(int32_t persistentId) override
165     {
166         return WSError::WS_OK;
167     }
RegisterIAbilityManagerCollaborator(int32_t type,const sptr<AAFwk::IAbilityManagerCollaborator> & impl)168     WSError RegisterIAbilityManagerCollaborator(int32_t type,
169         const sptr<AAFwk::IAbilityManagerCollaborator>& impl) override
170     {
171         return WSError::WS_OK;
172     }
UnregisterIAbilityManagerCollaborator(int32_t type)173     WSError UnregisterIAbilityManagerCollaborator(int32_t type) override
174     {
175         return WSError::WS_OK;
176     }
GetWindowStyleType(WindowStyleType & windowStyleType)177     WMError GetWindowStyleType(WindowStyleType& windowStyleType) override
178     {
179         return WMError::WM_OK;
180     }
TerminateSessionByPersistentId(int32_t persistentId)181     WMError TerminateSessionByPersistentId(int32_t persistentId) override
182     {
183         return WMError::WM_OK;
184     }
CloseTargetFloatWindow(const std::string & bundleName)185     WMError CloseTargetFloatWindow(const std::string& bundleName) override
186     {
187         return WMError::WM_OK;
188     }
CloseTargetPiPWindow(const std::string & bundleName)189     WMError CloseTargetPiPWindow(const std::string& bundleName) override
190     {
191         return WMError::WM_OK;
192     }
GetCurrentPiPWindowInfo(std::string & bundleName)193     WMError GetCurrentPiPWindowInfo(std::string& bundleName) override
194     {
195         bundleName = "test";
196         return WMError::WM_OK;
197     }
GetRootMainWindowId(int32_t persistentId,int32_t & hostWindowId)198     WMError GetRootMainWindowId(int32_t persistentId, int32_t& hostWindowId) override
199     {
200         return WMError::WM_OK;
201     }
GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>> & infos)202     WMError GetAccessibilityWindowInfo(std::vector<sptr<AccessibilityWindowInfo>>& infos) override
203     {
204         return WMError::WM_OK;
205     }
AsObject()206     sptr<IRemoteObject> AsObject() override
207     {
208         return nullptr;
209     }
CheckUIExtensionCreation(int32_t windowId,uint32_t tokenId,const AppExecFwk::ElementName & element,AppExecFwk::ExtensionAbilityType extensionAbilityType,int32_t & pid)210     WMError CheckUIExtensionCreation(int32_t windowId, uint32_t tokenId, const AppExecFwk::ElementName& element,
211         AppExecFwk::ExtensionAbilityType extensionAbilityType, int32_t& pid) override
212     {
213         return WMError::WM_OK;
214     }
NotifyAppUseControlList(ControlAppType type,int32_t userId,const std::vector<AppUseControlInfo> & controlList)215     WSError NotifyAppUseControlList(ControlAppType type, int32_t userId,
216         const std::vector<AppUseControlInfo>& controlList) override { return WSError::WS_OK; }
MinimizeMainSession(const std::string & bundleName,int32_t appIndex,int32_t userId)217     WMError MinimizeMainSession(const std::string& bundleName,
218         int32_t appIndex, int32_t userId) override { return WMError::WM_OK; }
HasFloatingWindowForeground(const sptr<IRemoteObject> & abilityToken,bool & hasFloatingShowing)219     WMError HasFloatingWindowForeground(const sptr<IRemoteObject>& abilityToken,
220         bool& hasFloatingShowing) override { return WMError::WM_OK; }
LockSessionByAbilityInfo(const AbilityInfoBase & abilityInfo,bool isLock)221     WMError LockSessionByAbilityInfo(const AbilityInfoBase& abilityInfo,
222         bool isLock) override { return WMError::WM_OK; }
RegisterSessionLifecycleListenerByIds(const sptr<ISessionLifecycleListener> & listener,const std::vector<int32_t> & persistentIdList)223     WMError RegisterSessionLifecycleListenerByIds(const sptr<ISessionLifecycleListener>& listener,
224         const std::vector<int32_t>& persistentIdList) override { return WMError::WM_OK; }
RegisterSessionLifecycleListenerByBundles(const sptr<ISessionLifecycleListener> & listener,const std::vector<std::string> & bundleNameList)225     WMError RegisterSessionLifecycleListenerByBundles(const sptr<ISessionLifecycleListener>& listener,
226         const std::vector<std::string>& bundleNameList) override { return WMError::WM_OK; }
UnregisterSessionLifecycleListener(const sptr<ISessionLifecycleListener> & listener)227     WMError UnregisterSessionLifecycleListener(const sptr<ISessionLifecycleListener>& listener)
228         override { return WMError::WM_OK; }
229 };
230 
231 class SceneSessionManagerLiteStubTest : public testing::Test {
232 public:
233     static void SetUpTestCase();
234     static void TearDownTestCase();
235     void SetUp() override;
236     void TearDown() override;
237     sptr<SceneSessionManagerLiteStub> sceneSessionManagerLiteStub_ = nullptr;
238 };
239 
SetUpTestCase()240 void SceneSessionManagerLiteStubTest::SetUpTestCase()
241 {
242 }
243 
TearDownTestCase()244 void SceneSessionManagerLiteStubTest::TearDownTestCase()
245 {
246 }
247 
SetUp()248 void SceneSessionManagerLiteStubTest::SetUp()
249 {
250     sceneSessionManagerLiteStub_ = sptr<MockSceneSessionManagerLiteStub>::MakeSptr();
251     EXPECT_NE(nullptr, sceneSessionManagerLiteStub_);
252 }
253 
TearDown()254 void SceneSessionManagerLiteStubTest::TearDown()
255 {
256     sceneSessionManagerLiteStub_ = nullptr;
257 }
258 
259 namespace {
260 /**
261  * @tc.name: OnRemoteRequest
262  * @tc.desc: test function : OnRemoteRequest
263  * @tc.type: FUNC
264  */
265 HWTEST_F(SceneSessionManagerLiteStubTest, OnRemoteRequest, Function | SmallTest | Level1)
266 {
267     uint32_t code = static_cast<uint32_t>(SceneSessionManagerLiteStub::
268         SceneSessionManagerLiteMessage::TRANS_ID_SET_SESSION_LABEL);
269     MessageParcel data;
270     MessageParcel reply;
271     MessageOption option;
272     data.WriteInterfaceToken(u"OpenHarmeny");
273     auto res = sceneSessionManagerLiteStub_->
274         SceneSessionManagerLiteStub::OnRemoteRequest(code, data, reply, option);
275     EXPECT_EQ(ERR_TRANSACTION_FAILED, res);
276     data.WriteInterfaceToken(SceneSessionManagerLiteStub::GetDescriptor());
277     res = sceneSessionManagerLiteStub_->
278         SceneSessionManagerLiteStub::OnRemoteRequest(1000, data, reply, option);
279     EXPECT_EQ(IPC_STUB_UNKNOW_TRANS_ERR, res);
280     data.WriteInterfaceToken(SceneSessionManagerLiteStub::GetDescriptor());
281     sptr<IRemoteObject> token = nullptr;
282     data.WriteRemoteObject(token);
283     data.WriteString("OnRemoteRequest UT Testing.");
284     res = sceneSessionManagerLiteStub_->
285         SceneSessionManagerLiteStub::OnRemoteRequest(code, data, reply, option);
286     EXPECT_EQ(ERR_NONE, res);
287 }
288 
289 /**
290  * @tc.name: HandleSetSessionIcon
291  * @tc.desc: test function : HandleSetSessionIcon
292  * @tc.type: FUNC
293  */
294 HWTEST_F(SceneSessionManagerLiteStubTest, HandleSetSessionIcon, Function | SmallTest | Level1)
295 {
296     MessageParcel data;
297     MessageParcel reply;
298     auto res = sceneSessionManagerLiteStub_->
299         SceneSessionManagerLiteStub::HandleSetSessionIcon(data, reply);
300     EXPECT_EQ(ERR_INVALID_DATA, res);
301 }
302 
303 /**
304  * @tc.name: HandleIsValidSessionIds
305  * @tc.desc: test function : HandleIsValidSessionIds
306  * @tc.type: FUNC
307  */
308 HWTEST_F(SceneSessionManagerLiteStubTest, HandleIsValidSessionIds, Function | SmallTest | Level1)
309 {
310     MessageParcel data;
311     MessageParcel reply;
312     auto res = sceneSessionManagerLiteStub_->
313         SceneSessionManagerLiteStub::HandleIsValidSessionIds(data, reply);
314     EXPECT_EQ(ERR_NONE, res);
315 }
316 
317 /**
318  * @tc.name: HandlePendingSessionToForeground
319  * @tc.desc: test function : HandlePendingSessionToForeground
320  * @tc.type: FUNC
321  */
322 HWTEST_F(SceneSessionManagerLiteStubTest, HandlePendingSessionToForeground, Function | SmallTest | Level1)
323 {
324     MessageParcel data;
325     MessageParcel reply;
326     auto res = sceneSessionManagerLiteStub_->
327         SceneSessionManagerLiteStub::HandlePendingSessionToForeground(data, reply);
328     EXPECT_EQ(ERR_INVALID_DATA, res);
329 }
330 
331 /**
332  * @tc.name: HandlePendingSessionToBackgroundForDelegator
333  * @tc.desc: test function : HandlePendingSessionToBackgroundForDelegator
334  * @tc.type: FUNC
335  */
336 HWTEST_F(SceneSessionManagerLiteStubTest, HandlePendingSessionToBackgroundForDelegator, Function | SmallTest | Level1)
337 {
338     MessageParcel data;
339     MessageParcel reply;
340     auto res = sceneSessionManagerLiteStub_->
341         SceneSessionManagerLiteStub::HandlePendingSessionToBackgroundForDelegator(data, reply);
342     EXPECT_EQ(ERR_INVALID_DATA, res);
343 }
344 
345 /**
346  * @tc.name: HandleRegisterSessionListener
347  * @tc.desc: test function : HandleRegisterSessionListener
348  * @tc.type: FUNC
349  */
350 HWTEST_F(SceneSessionManagerLiteStubTest, HandleRegisterSessionListener, Function | SmallTest | Level1)
351 {
352     MessageParcel data;
353     MessageParcel reply;
354     auto res = sceneSessionManagerLiteStub_->
355         SceneSessionManagerLiteStub::HandleRegisterSessionListener(data, reply);
356     EXPECT_EQ(ERR_NONE, res);
357 }
358 
359 /**
360  * @tc.name: HandleUnRegisterSessionListener
361  * @tc.desc: test function : HandleUnRegisterSessionListener
362  * @tc.type: FUNC
363  */
364 HWTEST_F(SceneSessionManagerLiteStubTest, HandleUnRegisterSessionListener, Function | SmallTest | Level1)
365 {
366     MessageParcel data;
367     MessageParcel reply;
368     auto res = sceneSessionManagerLiteStub_->
369         SceneSessionManagerLiteStub::HandleUnRegisterSessionListener(data, reply);
370     EXPECT_EQ(ERR_NONE, res);
371 }
372 
373 /**
374  * @tc.name: HandleGetSessionInfos
375  * @tc.desc: test function : HandleGetSessionInfos
376  * @tc.type: FUNC
377  */
378 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetSessionInfos, Function | SmallTest | Level1)
379 {
380     MessageParcel data;
381     MessageParcel reply;
382     auto res = sceneSessionManagerLiteStub_->
383         SceneSessionManagerLiteStub::HandleUnRegisterSessionListener(data, reply);
384     EXPECT_EQ(ERR_NONE, res);
385 }
386 
387 /**
388  * @tc.name: HandleGetMainWindowStatesByPid
389  * @tc.desc: test function : HandleGetMainWindowStatesByPid
390  * @tc.type: FUNC
391  */
392 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetMainWindowStatesByPid, Function | SmallTest | Level1)
393 {
394     MessageParcel data;
395     MessageParcel reply;
396     auto res = sceneSessionManagerLiteStub_->
397         SceneSessionManagerLiteStub::HandleGetMainWindowStatesByPid(data, reply);
398     EXPECT_EQ(res, ERR_INVALID_DATA);
399 }
400 
401 /**
402  * @tc.name: HandleGetSessionInfo
403  * @tc.desc: test function : HandleGetSessionInfo
404  * @tc.type: FUNC
405  */
406 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetSessionInfo, Function | SmallTest | Level1)
407 {
408     MessageParcel data;
409     MessageParcel reply;
410 
411     auto res = sceneSessionManagerLiteStub_->
412         SceneSessionManagerLiteStub::HandleGetSessionInfo(data, reply);
413     EXPECT_EQ(ERR_TRANSACTION_FAILED, res);
414 
415     std::u16string deviceIdU16 = u"testDeviceId";
416     data.WriteString16(deviceIdU16);
417     res = sceneSessionManagerLiteStub_->
418         SceneSessionManagerLiteStub::HandleGetSessionInfo(data, reply);
419     EXPECT_EQ(ERR_TRANSACTION_FAILED, res);
420 
421     int32_t persistentId = 0;
422     data.WriteString16(deviceIdU16);
423     data.WriteInt32(persistentId);
424     res = sceneSessionManagerLiteStub_->
425         SceneSessionManagerLiteStub::HandleGetSessionInfo(data, reply);
426     EXPECT_EQ(ERR_NONE, res);
427 }
428 
429 /**
430  * @tc.name: HandleGetSessionInfoByContinueSessionId
431  * @tc.desc: test function : HandleGetSessionInfoByContinueSessionId
432  * @tc.type: FUNC
433  */
434 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetSessionInfoByContinueSessionId, Function | SmallTest | Level1)
435 {
436     MessageParcel data;
437     MessageParcel reply;
438 
439     auto res = sceneSessionManagerLiteStub_->
440         SceneSessionManagerLiteStub::HandleGetSessionInfoByContinueSessionId(data, reply);
441     EXPECT_EQ(ERR_INVALID_DATA, res);
442 
443     std::string continueSessionId = "testSessionId";
444     data.WriteString(continueSessionId);
445     res = sceneSessionManagerLiteStub_->
446         SceneSessionManagerLiteStub::HandleGetSessionInfoByContinueSessionId(data, reply);
447     EXPECT_EQ(ERR_NONE, res);
448 }
449 
450 /**
451  * @tc.name: HandleTerminateSessionNew
452  * @tc.desc: test function : HandleTerminateSessionNew
453  * @tc.type: FUNC
454  */
455 HWTEST_F(SceneSessionManagerLiteStubTest, HandleTerminateSessionNew, Function | SmallTest | Level1)
456 {
457     MessageParcel data;
458     MessageParcel reply;
459     auto res = sceneSessionManagerLiteStub_->
460         SceneSessionManagerLiteStub::HandleTerminateSessionNew(data, reply);
461     EXPECT_EQ(ERR_INVALID_DATA, res);
462 }
463 
464 /**
465  * @tc.name: HandleGetFocusSessionToken
466  * @tc.desc: test function : HandleGetFocusSessionToken
467  * @tc.type: FUNC
468  */
469 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetFocusSessionToken, Function | SmallTest | Level1)
470 {
471     MessageParcel data;
472     MessageParcel reply;
473     data.WriteUint64(0);
474     auto res = sceneSessionManagerLiteStub_->
475         SceneSessionManagerLiteStub::HandleGetFocusSessionToken(data, reply);
476     EXPECT_EQ(ERR_NONE, res);
477 }
478 
479 /**
480  * @tc.name: HandleGetFocusSessionToken1
481  * @tc.desc: test function : HandleGetFocusSessionToken
482  * @tc.type: FUNC
483  */
484 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetFocusSessionToken1, Function | SmallTest | Level1)
485 {
486     MessageParcel data;
487     MessageParcel reply;
488     auto res = sceneSessionManagerLiteStub_->
489         SceneSessionManagerLiteStub::HandleGetFocusSessionToken(data, reply);
490     EXPECT_EQ(ERR_INVALID_DATA, res);
491 }
492 
493 /**
494  * @tc.name: HandleGetFocusSessionElement
495  * @tc.desc: test function : HandleGetFocusSessionElement
496  * @tc.type: FUNC
497  */
498 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetFocusSessionElement, Function | SmallTest | Level1)
499 {
500     MessageParcel data;
501     MessageParcel reply;
502     data.WriteUint64(0);
503     auto res = sceneSessionManagerLiteStub_->
504         SceneSessionManagerLiteStub::HandleGetFocusSessionElement(data, reply);
505     EXPECT_EQ(ERR_NONE, res);
506 }
507 
508 /**
509  * @tc.name: HandleGetFocusSessionElement1
510  * @tc.desc: test function : HandleGetFocusSessionElement
511  * @tc.type: FUNC
512  */
513 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetFocusSessionElement1, Function | SmallTest | Level1)
514 {
515     MessageParcel data;
516     MessageParcel reply;
517     auto res = sceneSessionManagerLiteStub_->
518         SceneSessionManagerLiteStub::HandleGetFocusSessionElement(data, reply);
519     EXPECT_EQ(ERR_INVALID_DATA, res);
520 }
521 
522 /**
523  * @tc.name: HandleSetSessionContinueState
524  * @tc.desc: test function : HandleSetSessionContinueState
525  * @tc.type: FUNC
526  */
527 HWTEST_F(SceneSessionManagerLiteStubTest, HandleSetSessionContinueState, Function | SmallTest | Level1)
528 {
529     MessageParcel data;
530     MessageParcel reply;
531 
532     sptr <IRemoteObject> token = nullptr;
533     data.WriteRemoteObject(token);
534     auto res = sceneSessionManagerLiteStub_->
535         SceneSessionManagerLiteStub::HandleSetSessionContinueState(data, reply);
536     EXPECT_EQ(ERR_TRANSACTION_FAILED, res);
537 
538     int32_t continueStateValue = -3;
539     data.WriteRemoteObject(token);
540     data.WriteInt32(continueStateValue);
541     res = sceneSessionManagerLiteStub_->
542         SceneSessionManagerLiteStub::HandleSetSessionContinueState(data, reply);
543     EXPECT_EQ(ERR_INVALID_DATA, res);
544 
545     continueStateValue = 1;
546     data.WriteRemoteObject(token);
547     data.WriteInt32(continueStateValue);
548     res = sceneSessionManagerLiteStub_->
549         SceneSessionManagerLiteStub::HandleSetSessionContinueState(data, reply);
550     EXPECT_EQ(ERR_NONE, res);
551 }
552 
553 /**
554  * @tc.name: HandleSetSessionContinueState1
555  * @tc.desc: test function : HandleSetSessionContinueState
556  * @tc.type: FUNC
557  */
558 HWTEST_F(SceneSessionManagerLiteStubTest, HandleSetSessionContinueState1, Function | SmallTest | Level1)
559 {
560     MessageParcel data;
561     MessageParcel reply;
562     data.WriteRemoteObject(nullptr);
563     data.WriteInt32(-2);
564     auto res = sceneSessionManagerLiteStub_->
565         SceneSessionManagerLiteStub::HandleSetSessionContinueState(data, reply);
566     EXPECT_EQ(res, ERR_INVALID_DATA);
567 }
568 
569 /**
570  * @tc.name: HandleSetSessionContinueState2
571  * @tc.desc: test function : HandleSetSessionContinueState
572  * @tc.type: FUNC
573  */
574 HWTEST_F(SceneSessionManagerLiteStubTest, HandleSetSessionContinueState2, Function | SmallTest | Level1)
575 {
576     MessageParcel data;
577     MessageParcel reply;
578     sptr<IRemoteObject> token = nullptr;
579     data.WriteRemoteObject(token);
580     data.WriteInt32(static_cast<int32_t>(ContinueState::CONTINUESTATE_MAX));
581     auto res = sceneSessionManagerLiteStub_->
582         SceneSessionManagerLiteStub::HandleSetSessionContinueState(data, reply);
583     EXPECT_EQ(res, ERR_NONE);
584     uint32_t writtenError;
585     EXPECT_TRUE(reply.ReadUint32(writtenError));
586     EXPECT_EQ(writtenError, static_cast<uint32_t>(ERR_NONE));
587 }
588 
589 /**
590  * @tc.name: HandleGetSessionSnapshot
591  * @tc.desc: test function : HandleGetSessionSnapshot
592  * @tc.type: FUNC
593  */
594 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetSessionSnapshot, Function | SmallTest | Level1)
595 {
596     MessageParcel data;
597     MessageParcel reply;
598     const std::u16string deviceId = static_cast<std::u16string>(u"123");
599     data.WriteString16(deviceId);
600     const std::int32_t persistentId = 1;
601     data.WriteInt32(persistentId);
602     const bool isLowResolution = true;
603     data.WriteBool(isLowResolution);
604     auto res = sceneSessionManagerLiteStub_->
605         SceneSessionManagerLiteStub::HandleGetSessionSnapshot(data, reply);
606     EXPECT_EQ(ERR_NONE, res);
607 }
608 
609 /**
610  * @tc.name: HandleClearSession
611  * @tc.desc: test function : HandleClearSession
612  * @tc.type: FUNC
613  */
614 HWTEST_F(SceneSessionManagerLiteStubTest, HandleClearSession, Function | SmallTest | Level1)
615 {
616     MessageParcel data;
617     MessageParcel reply;
618 
619     auto res = sceneSessionManagerLiteStub_->
620         SceneSessionManagerLiteStub::HandleClearSession(data, reply);
621     EXPECT_EQ(ERR_TRANSACTION_FAILED, res);
622 
623     int32_t persistentId = 0;
624     data.WriteInt32(persistentId);
625     res = sceneSessionManagerLiteStub_->
626         SceneSessionManagerLiteStub::HandleClearSession(data, reply);
627     EXPECT_EQ(ERR_NONE, res);
628 }
629 
630 /**
631  * @tc.name: HandleClearAllSessions
632  * @tc.desc: test function : HandleClearAllSessions
633  * @tc.type: FUNC
634  */
635 HWTEST_F(SceneSessionManagerLiteStubTest, HandleClearAllSessions, Function | SmallTest | Level1)
636 {
637     MessageParcel data;
638     MessageParcel reply;
639     auto res = sceneSessionManagerLiteStub_->
640         SceneSessionManagerLiteStub::HandleClearAllSessions(data, reply);
641     EXPECT_EQ(ERR_NONE, res);
642 }
643 
644 /**
645  * @tc.name: HandleLockSession
646  * @tc.desc: test function : HandleLockSession
647  * @tc.type: FUNC
648  */
649 HWTEST_F(SceneSessionManagerLiteStubTest, HandleLockSession, Function | SmallTest | Level1)
650 {
651     MessageParcel data;
652     MessageParcel reply;
653 
654     auto res = sceneSessionManagerLiteStub_->
655         SceneSessionManagerLiteStub::HandleLockSession(data, reply);
656     EXPECT_EQ(ERR_TRANSACTION_FAILED, res);
657 
658     int32_t persistentId = 0;
659     data.WriteInt32(persistentId);
660     res = sceneSessionManagerLiteStub_->
661         SceneSessionManagerLiteStub::HandleLockSession(data, reply);
662     EXPECT_EQ(ERR_NONE, res);
663 }
664 
665 /**
666  * @tc.name: HandleUnlockSession
667  * @tc.desc: test function : HandleUnlockSession
668  * @tc.type: FUNC
669  */
670 HWTEST_F(SceneSessionManagerLiteStubTest, HandleUnlockSession, Function | SmallTest | Level1)
671 {
672     MessageParcel data;
673     MessageParcel reply;
674 
675     auto res = sceneSessionManagerLiteStub_->
676         SceneSessionManagerLiteStub::HandleUnlockSession(data, reply);
677     EXPECT_EQ(ERR_TRANSACTION_FAILED, res);
678 
679     int32_t sessionId = 0;
680     data.WriteInt32(sessionId);
681     res = sceneSessionManagerLiteStub_->
682         SceneSessionManagerLiteStub::HandleUnlockSession(data, reply);
683     EXPECT_EQ(ERR_NONE, res);
684 }
685 
686 /**
687  * @tc.name: HandleMoveSessionsToForeground
688  * @tc.desc: test function : HandleMoveSessionsToForeground
689  * @tc.type: FUNC
690  */
691 HWTEST_F(SceneSessionManagerLiteStubTest, HandleMoveSessionsToForeground, Function | SmallTest | Level1)
692 {
693     MessageParcel data;
694     MessageParcel reply;
695 
696     auto res = sceneSessionManagerLiteStub_->
697         SceneSessionManagerLiteStub::HandleMoveSessionsToForeground(data, reply);
698     EXPECT_EQ(ERR_TRANSACTION_FAILED, res);
699 
700     std::vector<int32_t> sessionIds;
701     sessionIds.push_back(0);
702     data.WriteInt32Vector(sessionIds);
703     res = sceneSessionManagerLiteStub_->
704         SceneSessionManagerLiteStub::HandleMoveSessionsToForeground(data, reply);
705     EXPECT_EQ(ERR_TRANSACTION_FAILED, res);
706 
707     int32_t topSessionId = 0;
708     data.WriteInt32Vector(sessionIds);
709     data.WriteInt32(topSessionId);
710     res = sceneSessionManagerLiteStub_->
711         SceneSessionManagerLiteStub::HandleMoveSessionsToForeground(data, reply);
712     EXPECT_EQ(ERR_NONE, res);
713 }
714 
715 /**
716  * @tc.name: HandleMoveSessionsToBackground
717  * @tc.desc: test function : HandleMoveSessionsToBackground
718  * @tc.type: FUNC
719  */
720 HWTEST_F(SceneSessionManagerLiteStubTest, HandleMoveSessionsToBackground, Function | SmallTest | Level1)
721 {
722     MessageParcel data;
723     MessageParcel reply;
724     auto res = sceneSessionManagerLiteStub_->
725         SceneSessionManagerLiteStub::HandleMoveSessionsToBackground(data, reply);
726     EXPECT_EQ(ERR_NONE, res);
727 }
728 
729 /**
730  * @tc.name: HandleGetFocusSessionInfo
731  * @tc.desc: test function : HandleGetFocusSessionInfo
732  * @tc.type: FUNC
733  */
734 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetFocusSessionInfo, Function | SmallTest | Level1)
735 {
736     MessageParcel data;
737     MessageParcel reply;
738     data.WriteUint64(0);
739     auto res = sceneSessionManagerLiteStub_->
740         SceneSessionManagerLiteStub::HandleGetFocusSessionInfo(data, reply);
741     EXPECT_EQ(ERR_NONE, res);
742 }
743 
744 /**
745  * @tc.name: HandleGetFocusSessionInfo1
746  * @tc.desc: test function : HandleGetFocusSessionInfo
747  * @tc.type: FUNC
748  */
749 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetFocusSessionInfo1, Function | SmallTest | Level1)
750 {
751     MessageParcel data;
752     MessageParcel reply;
753     auto res = sceneSessionManagerLiteStub_->
754         SceneSessionManagerLiteStub::HandleGetFocusSessionInfo(data, reply);
755     EXPECT_EQ(ERR_INVALID_DATA, res);
756 }
757 
758 /**
759  * @tc.name: HandleCheckWindowId
760  * @tc.desc: test function : HandleCheckWindowId
761  * @tc.type: FUNC
762  */
763 HWTEST_F(SceneSessionManagerLiteStubTest, HandleCheckWindowId, Function | SmallTest | Level1)
764 {
765     MessageParcel data;
766     MessageParcel reply;
767     int32_t numMax = 100;
768     data.WriteInt32(numMax);
769     auto res = sceneSessionManagerLiteStub_->
770         SceneSessionManagerLiteStub::HandleCheckWindowId(data, reply);
771     EXPECT_EQ(ERR_NONE, res);
772 }
773 
774 /**
775  * @tc.name: HandleRegisterWindowManagerAgent
776  * @tc.desc: test function : HandleRegisterWindowManagerAgent
777  * @tc.type: FUNC
778  */
779 HWTEST_F(SceneSessionManagerLiteStubTest, HandleRegisterWindowManagerAgent, Function | SmallTest | Level1)
780 {
781     MessageParcel data;
782     MessageParcel reply;
783     data.WriteUint32(static_cast<uint32_t>(WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS));
784     auto res = sceneSessionManagerLiteStub_->
785         SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(data, reply);
786     EXPECT_EQ(ERR_NONE, res);
787 
788     data.WriteUint32(-100);
789     res = sceneSessionManagerLiteStub_->
790         SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(data, reply);
791     EXPECT_EQ(ERR_INVALID_DATA, res);
792 
793     data.WriteUint32(100);
794     res = sceneSessionManagerLiteStub_->
795         SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(data, reply);
796     EXPECT_EQ(ERR_INVALID_DATA, res);
797 
798     data.WriteUint32(5);
799     res = sceneSessionManagerLiteStub_->
800         SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(data, reply);
801     EXPECT_EQ(ERR_NONE, res);
802 }
803 
804 /**
805  * @tc.name: HandleUnregisterWindowManagerAgent
806  * @tc.desc: test function : HandleUnregisterWindowManagerAgent
807  * @tc.type: FUNC
808  */
809 HWTEST_F(SceneSessionManagerLiteStubTest, HandleUnregisterWindowManagerAgent, Function | SmallTest | Level1)
810 {
811     MessageParcel data;
812     MessageParcel reply;
813     data.WriteUint32(static_cast<uint32_t>(WindowManagerAgentType::WINDOW_MANAGER_AGENT_TYPE_FOCUS));
814     auto res = sceneSessionManagerLiteStub_->
815         SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(data, reply);
816     EXPECT_EQ(ERR_NONE, res);
817 
818     data.WriteUint32(-100);
819     res = sceneSessionManagerLiteStub_->
820         SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(data, reply);
821     EXPECT_EQ(ERR_INVALID_DATA, res);
822 
823     data.WriteUint32(100);
824     res = sceneSessionManagerLiteStub_->
825         SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(data, reply);
826     EXPECT_EQ(ERR_INVALID_DATA, res);
827 
828     data.WriteUint32(5);
829     res = sceneSessionManagerLiteStub_->
830         SceneSessionManagerLiteStub::HandleRegisterWindowManagerAgent(data, reply);
831     EXPECT_EQ(ERR_NONE, res);
832 }
833 
834 /**
835  * @tc.name: HandleListWindowInfo
836  * @tc.desc: test function : HandleListWindowInfo
837  * @tc.type: FUNC
838  */
839 HWTEST_F(SceneSessionManagerLiteStubTest, HandleListWindowInfo, Function | SmallTest | Level1)
840 {
841     MessageParcel data;
842     MessageParcel reply;
843     DisplayId displayId = 0;
844     int32_t windowId = 0;
845     data.WriteUint8(static_cast<WindowInfoFilterOptionDataType>(WindowInfoFilterOption::ALL));
846     data.WriteUint8(static_cast<WindowInfoTypeOptionDataType>(WindowInfoTypeOption::ALL));
847     data.WriteUint64(displayId);
848     data.WriteInt32(windowId);
849     auto res = sceneSessionManagerLiteStub_->
850         SceneSessionManagerLiteStub::HandleListWindowInfo(data, reply);
851     EXPECT_EQ(ERR_NONE, res);
852 }
853 
854 /**
855  * @tc.name: HandleGetVisibilityWindowInfo
856  * @tc.desc: test function : HandleGetVisibilityWindowInfo
857  * @tc.type: FUNC
858  */
859 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetVisibilityWindowInfo, Function | SmallTest | Level1)
860 {
861     MessageParcel data;
862     MessageParcel reply;
863     auto res = sceneSessionManagerLiteStub_->
864         SceneSessionManagerLiteStub::HandleGetVisibilityWindowInfo(data, reply);
865     EXPECT_EQ(ERR_NONE, res);
866 }
867 
868 /**
869  * @tc.name: HandleGetMainWinodowInfo
870  * @tc.desc: test function : HandleGetMainWinodowInfo
871  * @tc.type: FUNC
872  */
873 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetMainWinodowInfo, Function | SmallTest | Level1)
874 {
875     MessageParcel data;
876     MessageParcel reply;
877     int32_t numMax = 100;
878     data.WriteInt32(numMax);
879     auto res = sceneSessionManagerLiteStub_->
880         SceneSessionManagerLiteStub::HandleGetMainWinodowInfo(data, reply);
881     EXPECT_EQ(ERR_NONE, res);
882 }
883 
884 /**
885  * @tc.name: HandleGetAllMainWindowInfos
886  * @tc.desc: test function : HandleGetAllMainWindowInfos
887  * @tc.type: FUNC
888  */
889 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetAllMainWindowInfos, Function | SmallTest | Level1)
890 {
891     MessageParcel data;
892     MessageParcel reply;
893     auto res = sceneSessionManagerLiteStub_->
894         SceneSessionManagerLiteStub::HandleGetAllMainWindowInfos(data, reply);
895     EXPECT_EQ(ERR_NONE, res);
896 }
897 
898 /**
899  * @tc.name: HandleClearMainSessions
900  * @tc.desc: test function : HandleClearMainSessions
901  * @tc.type: FUNC
902  */
903 HWTEST_F(SceneSessionManagerLiteStubTest, HandleClearMainSessions, Function | SmallTest | Level1)
904 {
905     MessageParcel data;
906     MessageParcel reply;
907     std::vector<int32_t> persistentIds = {1, 2, 3};
908     data.WriteInt32Vector(persistentIds);
909     auto res = sceneSessionManagerLiteStub_->
910         SceneSessionManagerLiteStub::HandleClearMainSessions(data, reply);
911     EXPECT_EQ(ERR_NONE, res);
912 }
913 
914 /**
915  * @tc.name: HandleRaiseWindowToTop
916  * @tc.desc: test function : HandleRaiseWindowToTop
917  * @tc.type: FUNC
918  */
919 HWTEST_F(SceneSessionManagerLiteStubTest, HandleRaiseWindowToTop, Function | SmallTest | Level1)
920 {
921     MessageParcel data;
922     MessageParcel reply;
923     int32_t persistentId = 65535;
924     data.WriteInt32(persistentId);
925     auto res = sceneSessionManagerLiteStub_->
926         SceneSessionManagerLiteStub::HandleRaiseWindowToTop(data, reply);
927     EXPECT_EQ(ERR_NONE, res);
928 }
929 
930 /**
931  * @tc.name: HandleTerminateSessionByPersistentId
932  * @tc.desc: test function : HandleTerminateSessionByPersistentId
933  * @tc.type: FUNC
934  */
935 HWTEST_F(SceneSessionManagerLiteStubTest, HandleTerminateSessionByPersistentId, Function | SmallTest | Level1)
936 {
937     MessageParcel data;
938     MessageParcel reply;
939 
940     auto res = sceneSessionManagerLiteStub_->
941     SceneSessionManagerLiteStub::HandleTerminateSessionByPersistentId(data, reply);
942     EXPECT_EQ(ERR_INVALID_DATA, res);
943 
944     int32_t persistentId = 1;
945     data.WriteInt32(persistentId);
946     res = sceneSessionManagerLiteStub_->
947         SceneSessionManagerLiteStub::HandleTerminateSessionByPersistentId(data, reply);
948     EXPECT_EQ(ERR_NONE, res);
949 }
950 
951 /**
952  * @tc.name: HandleGetWindowStyleType
953  * @tc.desc: test function : HandleGetWindowStyleType
954  * @tc.type: FUNC
955  */
956 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetWindowStyleType, Function | SmallTest | Level1)
957 {
958     MessageParcel data;
959     MessageParcel reply;
960     auto res = sceneSessionManagerLiteStub_->
961         SceneSessionManagerLiteStub::HandleGetWindowStyleType(data, reply);
962     EXPECT_EQ(ERR_NONE, res);
963 }
964 
965 /**
966  * @tc.name: HandleCloseTargetFloatWindow
967  * @tc.desc: test function : HandleCloseTargetFloatWindow
968  * @tc.type: FUNC
969  */
970 HWTEST_F(SceneSessionManagerLiteStubTest, HandleCloseTargetFloatWindow, Function | SmallTest | Level1)
971 {
972     MessageParcel data;
973     MessageParcel reply;
974     data.WriteString("test");
975     auto res = sceneSessionManagerLiteStub_->
976         SceneSessionManagerLiteStub::HandleCloseTargetFloatWindow(data, reply);
977     EXPECT_EQ(ERR_NONE, res);
978 }
979 
980 /**
981  * @tc.name: HandleCloseTargetPiPWindow
982  * @tc.desc: test function : HandleCloseTargetPiPWindow
983  * @tc.type: FUNC
984  */
985 HWTEST_F(SceneSessionManagerLiteStubTest, HandleCloseTargetPiPWindow, Function | SmallTest | Level1)
986 {
987     MessageParcel data;
988     MessageParcel reply;
989     auto res = sceneSessionManagerLiteStub_->
990         SceneSessionManagerLiteStub::HandleCloseTargetPiPWindow(data, reply);
991     EXPECT_EQ(ERR_NONE, res);
992 }
993 
994 /**
995  * @tc.name: HandleGetCurrentPiPWindowInfo
996  * @tc.desc: test function : HandleGetCurrentPiPWindowInfo
997  * @tc.type: FUNC
998  */
999 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetCurrentPiPWindowInfo, Function | SmallTest | Level1)
1000 {
1001     MessageParcel data;
1002     MessageParcel reply;
1003     auto res = sceneSessionManagerLiteStub_->
1004         SceneSessionManagerLiteStub::HandleGetCurrentPiPWindowInfo(data, reply);
1005     EXPECT_EQ(ERR_NONE, res);
1006 }
1007 
1008 /**
1009  * @tc.name: HandleGetRootMainWindowId
1010  * @tc.desc: test function : HandleGetRootMainWindowId
1011  * @tc.type: FUNC
1012  */
1013 HWTEST_F(SceneSessionManagerLiteStubTest, HandleGetRootMainWindowId, Function | SmallTest | Level1)
1014 {
1015     MessageParcel data;
1016     MessageParcel reply;
1017     int32_t persistentId = 1;
1018     data.WriteInt32(persistentId);
1019     auto res = sceneSessionManagerLiteStub_->
1020         SceneSessionManagerLiteStub::HandleGetRootMainWindowId(data, reply);
1021     EXPECT_EQ(ERR_NONE, res);
1022 }
1023 
1024 /**
1025  * @tc.name: HandleNotifyAppUseControlList
1026  * @tc.desc: test function : HandleNotifyAppUseControlList
1027  * @tc.type: FUNC
1028  */
1029 HWTEST_F(SceneSessionManagerLiteStubTest, HandleNotifyAppUseControlList, Function | SmallTest | Level1)
1030 {
1031     MessageParcel data;
1032     MessageParcel reply;
1033     uint8_t typeId = 1;
1034     int32_t userId = 1;
1035     int32_t size = 1;
1036     std::string bundleName = "appbundleName";
1037     int32_t appIndex = 1;
1038     bool isControl = true;
1039 
1040     data.WriteUint8(typeId);
1041     data.WriteInt32(userId);
1042     data.WriteInt32(size);
1043     data.WriteString(bundleName);
1044     data.WriteInt32(appIndex);
1045     data.WriteBool(isControl);
1046 
1047     auto res = sceneSessionManagerLiteStub_->
1048         SceneSessionManagerLiteStub::HandleNotifyAppUseControlList(data, reply);
1049     EXPECT_EQ(ERR_INVALID_DATA, res);
1050 }
1051 
1052 /**
1053  * @tc.name: HandleMinimizeMainSession
1054  * @tc.desc: test function : HandleMinimizeMainSession
1055  * @tc.type: FUNC
1056  */
1057 HWTEST_F(SceneSessionManagerLiteStubTest, HandleMinimizeMainSession, Function | SmallTest | Level1)
1058 {
1059     MessageParcel data;
1060     MessageParcel reply;
1061     std::string bundleName = "appbundleName";
1062     int32_t appIndex = 1;
1063     int32_t userId = 1;
1064 
1065     data.WriteString(bundleName);
1066     data.WriteInt32(appIndex);
1067     data.WriteInt32(userId);
1068 
1069     auto res = sceneSessionManagerLiteStub_->SceneSessionManagerLiteStub::HandleMinimizeMainSession(data, reply);
1070     EXPECT_EQ(ERR_NONE, res);
1071 }
1072 
1073 /**
1074  * @tc.name: HandleLockSessionByAbilityInfo
1075  * @tc.desc: test function : HandleLockSessionByAbilityInfo
1076  * @tc.type: FUNC
1077  */
1078 HWTEST_F(SceneSessionManagerLiteStubTest, HandleLockSessionByAbilityInfo, Function | SmallTest | Level1)
1079 {
1080     MessageParcel data;
1081     MessageParcel reply;
1082     std::string bundleName = "appbundleName";
1083     std::string moduleName = "moduleName";
1084     std::string abilityName = "abilityName";
1085     int32_t appIndex = 0;
1086     bool isLock = true;
1087 
1088     data.WriteString(bundleName);
1089     data.WriteString(moduleName);
1090     data.WriteString(abilityName);
1091     data.WriteInt32(appIndex);
1092     data.WriteBool(isLock);
1093 
1094     auto res =
1095         sceneSessionManagerLiteStub_->SceneSessionManagerLiteStub::HandleLockSessionByAbilityInfo(data, reply);
1096     EXPECT_EQ(ERR_NONE, res);
1097 }
1098 }
1099 }
1100 }