• 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 #include <gtest/gtest.h>
17 #include <pointer_event.h>
18 #include "session/host/include/main_session.h"
19 
20 #include "common/include/session_permission.h"
21 #include "key_event.h"
22 #include "mock/mock_session_stage.h"
23 #include "session/host/include/session.h"
24 #include "session/host/include/system_session.h"
25 #include <ui/rs_surface_node.h>
26 #include "window_event_channel_base.h"
27 #include "window_helper.h"
28 #include "window_manager_hilog.h"
29 
30 using namespace testing;
31 using namespace testing::ext;
32 
33 namespace OHOS {
34 namespace Rosen {
35 class MainSessionTest : public testing::Test {
36 public:
37     static void SetUpTestCase();
38     static void TearDownTestCase();
39     void SetUp() override;
40     void TearDown() override;
41     SessionInfo info;
42     sptr<MainSession::SpecificSessionCallback> specificCallback = nullptr;
43     sptr<MainSession> mainSession_;
44 private:
45     RSSurfaceNode::SharedPtr CreateRSSurfaceNode();
46 };
47 
SetUpTestCase()48 void MainSessionTest::SetUpTestCase()
49 {
50 }
51 
TearDownTestCase()52 void MainSessionTest::TearDownTestCase()
53 {
54 }
55 
SetUp()56 void MainSessionTest::SetUp()
57 {
58     SessionInfo info;
59     info.abilityName_ = "testMainSession1";
60     info.moduleName_ = "testMainSession2";
61     info.bundleName_ = "testMainSession3";
62     mainSession_ = sptr<MainSession>::MakeSptr(info, specificCallback);
63     EXPECT_NE(nullptr, mainSession_);
64 }
65 
TearDown()66 void MainSessionTest::TearDown()
67 {
68     mainSession_ = nullptr;
69 }
70 
CreateRSSurfaceNode()71 RSSurfaceNode::SharedPtr MainSessionTest::CreateRSSurfaceNode()
72 {
73     struct RSSurfaceNodeConfig rsSurfaceNodeConfig;
74     rsSurfaceNodeConfig.SurfaceNodeName = "WindowSessionTestSurfaceNode";
75     auto surfaceNode = RSSurfaceNode::Create(rsSurfaceNodeConfig);
76     return surfaceNode;
77 }
78 
79 namespace {
80 
81 /**
82  * @tc.name: MainSession01
83  * @tc.desc: check func MainSession
84  * @tc.type: FUNC
85  */
86 HWTEST_F(MainSessionTest, MainSession01, Function | SmallTest | Level1)
87 {
88     MainSession* pMainSession = nullptr;
89     sptr<MainSession::SpecificSessionCallback> pSpecificCallback = nullptr;
90 
91     SessionInfo info;
92     info.persistentId_ = -1;
93     info.abilityName_ = "";
94     info.moduleName_ = "";
95     info.bundleName_ = "";
96     pMainSession = sptr<MainSession>::MakeSptr(info, pSpecificCallback);
97     EXPECT_NE(nullptr, pMainSession);
98 
99     info.persistentId_ = 0;
100     pMainSession = sptr<MainSession>::MakeSptr(info, pSpecificCallback);
101     EXPECT_NE(nullptr, pMainSession);
102 
103     info.persistentId_ = -1;
104     info.abilityName_ = "MainSession01";
105     info.moduleName_ = "MainSession02";
106     info.bundleName_ = "MainSession03";
107     pSpecificCallback = new(std::nothrow) MainSession::SpecificSessionCallback;
108     pMainSession = sptr<MainSession>::MakeSptr(info, pSpecificCallback);
109     EXPECT_NE(nullptr, pMainSession);
110 
111     info.persistentId_ = 0;
112     pMainSession = sptr<MainSession>::MakeSptr(info, pSpecificCallback);
113     EXPECT_NE(nullptr, pMainSession);
114 }
115 
116 /**
117  * @tc.name: TransferKeyEvent01
118  * @tc.desc: check func TransferKeyEvent
119  * @tc.type: FUNC
120  */
121 HWTEST_F(MainSessionTest, TransferKeyEvent01, Function | SmallTest | Level1)
122 {
123     mainSession_->state_ = SessionState::STATE_END;
124 
125     ASSERT_EQ(WSError::WS_ERROR_INVALID_SESSION, mainSession_->TransferKeyEvent(nullptr));
126 }
127 
128 /**
129  * @tc.name: TransferKeyEvent02
130  * @tc.desc: check func TransferKeyEvent
131  * @tc.type: FUNC
132  */
133 HWTEST_F(MainSessionTest, TransferKeyEvent02, Function | SmallTest | Level1)
134 {
135     mainSession_->state_ = SessionState::STATE_CONNECT;
136     std::shared_ptr<MMI::KeyEvent> keyEvent = nullptr;
137     mainSession_->ClearDialogVector();
138     ASSERT_EQ(WSError::WS_ERROR_NULLPTR, mainSession_->TransferKeyEvent(keyEvent));
139 }
140 
141 /**
142  * @tc.name: TransferKeyEvent03
143  * @tc.desc: check func TransferKeyEvent
144  * @tc.type: FUNC
145  */
146 HWTEST_F(MainSessionTest, TransferKeyEvent03, Function | SmallTest | Level1)
147 {
148     mainSession_->state_ = SessionState::STATE_CONNECT;
149     std::shared_ptr<MMI::KeyEvent> keyEvent = MMI::KeyEvent::Create();
150     ASSERT_NE(keyEvent, nullptr);
151     SessionInfo info;
152     info.abilityName_ = "testDialogSession1";
153     info.moduleName_ = "testDialogSession2";
154     info.bundleName_ = "testDialogSession3";
155     sptr<Session> dialogSession = sptr<SystemSession>::MakeSptr(info, nullptr);
156     dialogSession->SetSessionState(SessionState::STATE_ACTIVE);
157     mainSession_->BindDialogToParentSession(dialogSession);
158 
159     ASSERT_EQ(WSError::WS_ERROR_INVALID_PERMISSION, mainSession_->TransferKeyEvent(keyEvent));
160 }
161 
162 /**
163  * @tc.name: ProcessPointDownSession01
164  * @tc.desc: check func ProcessPointDownSession
165  * @tc.type: FUNC
166  */
167 HWTEST_F(MainSessionTest, ProcessPointDownSession01, Function | SmallTest | Level1)
168 {
169     EXPECT_EQ(WSError::WS_OK, mainSession_->ProcessPointDownSession(100, 200));
170     mainSession_->ClearDialogVector();
171     EXPECT_EQ(WSError::WS_OK, mainSession_->ProcessPointDownSession(10, 20));
172 }
173 
174 /**
175  * @tc.name: ProcessPointDownSession02
176  * @tc.desc: check func ProcessPointDownSession
177  * @tc.type: FUNC
178  */
179 HWTEST_F(MainSessionTest, ProcessPointDownSession02, Function | SmallTest | Level1)
180 {
181     mainSession_->BindDialogToParentSession(mainSession_);
182     EXPECT_EQ(WSError::WS_OK, mainSession_->ProcessPointDownSession(10, 20));
183 }
184 
185 /**
186  * @tc.name: SetTopmost01
187  * @tc.desc: check func SetTopmost
188  * @tc.type: FUNC
189  */
190 HWTEST_F(MainSessionTest, SetTopmost01, Function | SmallTest | Level1)
191 {
192     EXPECT_EQ(WSError::WS_OK, mainSession_->SetTopmost(true));
193     EXPECT_EQ(WSError::WS_OK, mainSession_->SetTopmost(false));
194 }
195 
196 /**
197  * @tc.name: SetTopmost02
198  * @tc.desc: check func SetTopmost
199  * @tc.type: FUNC
200  */
201 HWTEST_F(MainSessionTest, SetTopmost02, Function | SmallTest | Level1)
202 {
203     sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
204     mainSession_->SetSessionProperty(property);
205     ASSERT_TRUE(mainSession_->GetSessionProperty() != nullptr);
206     EXPECT_EQ(WSError::WS_OK, mainSession_->SetTopmost(true));
207 }
208 
209 /**
210  * @tc.name: UpdatePointerArea
211  * @tc.desc: check func UpdatePointerArea
212  * @tc.type: FUNC
213  */
214 HWTEST_F(MainSessionTest, UpdatePointerArea, Function | SmallTest | Level1)
215 {
216     WSRect Rect={0, 0, 50, 50};
217     mainSession_->UpdateWindowMode(WindowMode::WINDOW_MODE_UNDEFINED);
218     mainSession_->UpdatePointerArea(Rect);
219     mainSession_->UpdateWindowMode(WindowMode::WINDOW_MODE_FLOATING);
220     mainSession_->UpdatePointerArea(Rect);
221     ASSERT_EQ(Rect, mainSession_->preRect_);
222 }
223 
224 /**
225  * @tc.name: CheckPointerEventDispatch
226  * @tc.desc: check func CheckPointerEventDispatch
227  * @tc.type: FUNC
228  */
229 HWTEST_F(MainSessionTest, CheckPointerEventDispatch, Function | SmallTest | Level1)
230 {
231     std::shared_ptr<MMI::PointerEvent> pointerEvent = MMI::PointerEvent::Create();
232 
233     mainSession_->SetSessionState(SessionState::STATE_FOREGROUND);
234     bool res = mainSession_->CheckPointerEventDispatch(pointerEvent);
235     ASSERT_EQ(res, true);
236 
237     mainSession_->SetSessionState(SessionState::STATE_ACTIVE);
238     res = mainSession_->CheckPointerEventDispatch(pointerEvent);
239     ASSERT_EQ(res, true);
240 
241     pointerEvent->SetPointerAction(MMI::PointerEvent::POINTER_ACTION_LEAVE_WINDOW);
242     mainSession_->SetSessionState(SessionState::STATE_DISCONNECT);
243     res = mainSession_->CheckPointerEventDispatch(pointerEvent);
244     ASSERT_EQ(res, true);
245 
246     pointerEvent->SetPointerAction(MMI::PointerEvent::POINTER_ACTION_PULL_DOWN);
247     mainSession_->SetSessionState(SessionState::STATE_DISCONNECT);
248     res = mainSession_->CheckPointerEventDispatch(pointerEvent);
249     ASSERT_EQ(res, false);
250 }
251 
252 /**
253  * @tc.name: RectCheck03
254  * @tc.desc: check func RectCheck
255  * @tc.type: FUNC
256  */
257 HWTEST_F(MainSessionTest, RectCheck03, Function | SmallTest | Level1)
258 {
259     ASSERT_NE(mainSession_, nullptr);
260     SessionInfo info;
261     info.abilityName_ = "testMainSessionRectCheck";
262     info.moduleName_ = "testMainSessionRectCheck";
263     info.bundleName_ = "testMainSessionRectCheck";
264     sptr<Session> session = sptr<Session>::MakeSptr(info);
265     EXPECT_NE(nullptr, session);
266     mainSession_->parentSession_ = session;
267     uint32_t curWidth = 100;
268     uint32_t curHeight = 200;
269     mainSession_->RectCheck(curWidth, curHeight);
270 
271     curWidth = 300;
272     curHeight = 200;
273     mainSession_->RectCheck(curWidth, curHeight);
274 
275     curWidth = 1930;
276     curHeight = 200;
277     mainSession_->RectCheck(curWidth, curHeight);
278 
279     curWidth = 330;
280     curHeight = 200;
281     mainSession_->RectCheck(curWidth, curHeight);
282 
283     curWidth = 330;
284     curHeight = 1930;
285     mainSession_->RectCheck(curWidth, curHeight);
286 }
287 
288 /**
289  * @tc.name: SetExitSplitOnBackground
290  * @tc.desc: check func SetExitSplitOnBackground
291  * @tc.type: FUNC
292  */
293 HWTEST_F(MainSessionTest, SetExitSplitOnBackground, Function | SmallTest | Level1)
294 {
295     bool isExitSplitOnBackground = true;
296     mainSession_->SetExitSplitOnBackground(isExitSplitOnBackground);
297     ASSERT_EQ(true, isExitSplitOnBackground);
298 }
299 
300 /**
301  * @tc.name: IsExitSplitOnBackground01
302  * @tc.desc: check func IsExitSplitOnBackground
303  * @tc.type: FUNC
304  */
305 HWTEST_F(MainSessionTest, IsExitSplitOnBackground01, Function | SmallTest | Level1)
306 {
307     bool isExitSplitOnBackground = true;
308     mainSession_->SetExitSplitOnBackground(isExitSplitOnBackground);
309     bool ret = mainSession_->IsExitSplitOnBackground();
310     ASSERT_EQ(true, ret);
311 }
312 
313 /**
314  * @tc.name: IsExitSplitOnBackground02
315  * @tc.desc: check func IsExitSplitOnBackground
316  * @tc.type: FUNC
317  */
318 HWTEST_F(MainSessionTest, IsExitSplitOnBackground02, Function | SmallTest | Level1)
319 {
320     bool isExitSplitOnBackground = false;
321     mainSession_->SetExitSplitOnBackground(isExitSplitOnBackground);
322     bool ret = mainSession_->IsExitSplitOnBackground();
323     ASSERT_EQ(false, ret);
324 }
325 
326 /**
327  * @tc.name: OnTitleAndDockHoverShowChange
328  * @tc.desc: OnTitleAndDockHoverShowChange
329  * @tc.type: FUNC
330  */
331 HWTEST_F(MainSessionTest, OnTitleAndDockHoverShowChange, Function | SmallTest | Level2)
332 {
333     SessionInfo info;
334     info.abilityName_ = "OnTitleAndDockHoverShowChange";
335     info.bundleName_ = "OnTitleAndDockHoverShowChange";
336     sptr<SceneSession> sceneSession = sptr<SceneSession>::MakeSptr(info, nullptr);
__anon6f268c810202(bool isTitleHoverShown, bool isDockHoverShown) 337     sceneSession->SetTitleAndDockHoverShowChangeCallback([](bool isTitleHoverShown, bool isDockHoverShown) {
338         return;
339     });
340     EXPECT_NE(sceneSession->onTitleAndDockHoverShowChangeFunc_, nullptr);
341     EXPECT_EQ(sceneSession->OnTitleAndDockHoverShowChange(true, true), WSError::WS_OK);
342 }
343 
344 /**
345  * @tc.name: OnRestoreMainWindow
346  * @tc.desc: OnRestoreMainWindow function01
347  * @tc.type: FUNC
348  */
349 HWTEST_F(MainSessionTest, OnRestoreMainWindow, Function | SmallTest | Level2)
350 {
351     SessionInfo info;
352     info.abilityName_ = "OnRestoreMainWindow";
353     info.bundleName_ = "OnRestoreMainWindow";
354     sptr<SceneSession> session = sptr<SceneSession>::MakeSptr(info, nullptr);
355     EXPECT_NE(session, nullptr);
356     EXPECT_EQ(WSError::WS_OK, session->OnRestoreMainWindow());
357 
358     session->onRestoreMainWindowFunc_ = nullptr;
359     EXPECT_EQ(WSError::WS_OK, session->OnRestoreMainWindow());
360 
__anon6f268c810302null361     NotifyRestoreMainWindowFunc func = [] {
362         return;
363     };
364     session->onRestoreMainWindowFunc_ = func;
365     EXPECT_EQ(WSError::WS_OK, session->OnRestoreMainWindow());
366 }
367 
368 /**
369  * @tc.name: OnSetWindowRectAutoSave
370  * @tc.desc: OnSetWindowRectAutoSave
371  * @tc.type: FUNC
372  */
373 HWTEST_F(MainSessionTest, OnSetWindowRectAutoSave, Function | SmallTest | Level2)
374 {
375     SessionInfo info;
376     info.abilityName_ = "OnSetWindowRectAutoSave";
377     info.bundleName_ = "OnSetWindowRectAutoSave";
378     sptr<SceneSession> session = sptr<SceneSession>::MakeSptr(info, nullptr);
379 
380     session->onSetWindowRectAutoSaveFunc_ = nullptr;
381     EXPECT_EQ(nullptr, session->onSetWindowRectAutoSaveFunc_);
382 
__anon6f268c810402(bool enabled, bool isSaveBySpecifiedFlag) 383     NotifySetWindowRectAutoSaveFunc func = [](bool enabled, bool isSaveBySpecifiedFlag) {
384         return;
385     };
386     session->onSetWindowRectAutoSaveFunc_ = func;
387     EXPECT_NE(nullptr, session->onSetWindowRectAutoSaveFunc_);
388     EXPECT_EQ(false, session->GetSessionProperty()->GetIsSaveBySpecifiedFlag());
389 }
390 
391 /**
392  * @tc.name: NotifyMainModalTypeChange
393  * @tc.desc: NotifyMainModalTypeChange function01
394  * @tc.type: FUNC
395  */
396 HWTEST_F(MainSessionTest, NotifyMainModalTypeChange, Function | SmallTest | Level2)
397 {
398     SessionInfo info;
399     info.abilityName_ = "NotifyMainModalTypeChange";
400     info.bundleName_ = "NotifyMainModalTypeChange";
401     sptr<SceneSession> sceneSession = sptr<SceneSession>::MakeSptr(info, nullptr);
402     EXPECT_NE(sceneSession, nullptr);
__anon6f268c810502(bool isModal) 403     sceneSession->RegisterMainModalTypeChangeCallback([](bool isModal) {
404         return;
405     });
406     EXPECT_NE(sceneSession->onMainModalTypeChange_, nullptr);
407     EXPECT_EQ(WSError::WS_OK, sceneSession->NotifyMainModalTypeChange(true));
408 }
409 
410 /**
411  * @tc.name: IsModal
412  * @tc.desc: IsModal function01
413  * @tc.type: FUNC
414  */
415 HWTEST_F(MainSessionTest, IsModal, Function | SmallTest | Level2)
416 {
417     SessionInfo info;
418     info.abilityName_ = "IsModal";
419     info.bundleName_ = "IsModal";
420     sptr<MainSession> sceneSession = sptr<MainSession>::MakeSptr(info, nullptr);
421     EXPECT_NE(sceneSession, nullptr);
422     EXPECT_EQ(sceneSession->IsModal(), false);
423     sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
424     property->SetWindowType(WindowType::WINDOW_TYPE_APP_MAIN_WINDOW);
425     property->AddWindowFlag(WindowFlag::WINDOW_FLAG_IS_MODAL);
426     sceneSession->SetSessionProperty(property);
427     EXPECT_EQ(sceneSession->IsModal(), true);
428 }
429 
430 /**
431  * @tc.name: IsApplicationModal
432  * @tc.desc: IsApplicationModal function01
433  * @tc.type: FUNC
434  */
435 HWTEST_F(MainSessionTest, IsApplicationModal, Function | SmallTest | Level2)
436 {
437     SessionInfo info;
438     info.abilityName_ = "IsApplicationModal";
439     info.bundleName_ = "IsApplicationModal";
440     sptr<MainSession> sceneSession = sptr<MainSession>::MakeSptr(info, nullptr);
441     EXPECT_NE(sceneSession, nullptr);
442     EXPECT_EQ(sceneSession->IsApplicationModal(), false);
443     sptr<WindowSessionProperty> property = sptr<WindowSessionProperty>::MakeSptr();
444     property->SetWindowType(WindowType::WINDOW_TYPE_APP_MAIN_WINDOW);
445     property->AddWindowFlag(WindowFlag::WINDOW_FLAG_IS_MODAL);
446     sceneSession->SetSessionProperty(property);
447     EXPECT_EQ(sceneSession->IsApplicationModal(), true);
448 }
449 
450 /**
451  * @tc.name: NotifySupportWindowModesChange
452  * @tc.desc: NotifySupportWindowModesChange
453  * @tc.type: FUNC
454  */
455 HWTEST_F(MainSessionTest, NotifySupportWindowModesChange, Function | SmallTest | Level2)
456 {
457     SessionInfo info;
458     info.abilityName_ = "NotifySupportWindowModesChange";
459     info.bundleName_ = "NotifySupportWindowModesChange";
460     sptr<SceneSession> session = sptr<SceneSession>::MakeSptr(info, nullptr);
461 
462     std::vector<AppExecFwk::SupportWindowMode> supportedWindowModes = {
463         AppExecFwk::SupportWindowMode::FULLSCREEN,
464         AppExecFwk::SupportWindowMode::SPLIT,
465         AppExecFwk::SupportWindowMode::FLOATING
466     };
467 
468     EXPECT_EQ(WSError::WS_OK, session->NotifySupportWindowModesChange(supportedWindowModes));
469 
470     session->onSetSupportedWindowModesFunc_ = nullptr;
471     EXPECT_EQ(WSError::WS_OK, session->NotifySupportWindowModesChange(supportedWindowModes));
472 
473     session->onSetSupportedWindowModesFunc_ = [](
__anon6f268c810602( std::vector<AppExecFwk::SupportWindowMode>&& supportedWindowModes) 474         std::vector<AppExecFwk::SupportWindowMode>&& supportedWindowModes) {
475         return;
476     };
477 
478     EXPECT_EQ(WSError::WS_OK, session->NotifySupportWindowModesChange(supportedWindowModes));
479 }
480 
481 /**
482  * @tc.name: NotifySessionLockStateChange
483  * @tc.desc: NotifySessionLockStateChange
484  * @tc.type: FUNC
485  */
486 HWTEST_F(MainSessionTest, NotifySessionLockStateChange, Function | SmallTest | Level2)
487 {
488     SessionInfo info;
489     info.bundleName_ = "NotifySessionLockStateChangeBundle";
490     info.moduleName_ = "NotifySessionLockStateChangeModule";
491     info.abilityName_ = "NotifySessionLockStateChangeAbility";
492     info.appIndex_ = 0;
493 
494     sptr<MainSession> session = sptr<MainSession>::MakeSptr(info, nullptr);
495 
496     session->NotifySessionLockStateChange(true);
497     EXPECT_EQ(session->GetSessionLockState(), true);
498 }
499 
500 /**
501  * @tc.name: UpdateFlag
502  * @tc.desc: UpdateFlag
503  * @tc.type: FUNC
504  */
505 HWTEST_F(MainSessionTest, UpdateFlag, Function | SmallTest | Level2)
506 {
507     SessionInfo info;
508     info.abilityName_ = "UpdateFlag";
509     info.bundleName_ = "UpdateFlag";
510     sptr<SceneSession> session = sptr<SceneSession>::MakeSptr(info, nullptr);
511 
512     session->onUpdateFlagFunc_ = nullptr;
513     EXPECT_EQ(nullptr, session->onUpdateFlagFunc_);
514 
__anon6f268c810702(const std::string& flag) 515     NotifyUpdateFlagFunc func = [](const std::string& flag) {
516         return;
517     };
518     session->onUpdateFlagFunc_ = func;
519     EXPECT_NE(nullptr, session->onUpdateFlagFunc_);
520 }
521 
522 /**
523  * @tc.name: NotifySubAndDialogFollowRectChange
524  * @tc.desc: NotifySubAndDialogFollowRectChange
525  * @tc.type: FUNC
526  */
527 HWTEST_F(MainSessionTest, NotifySubAndDialogFollowRectChange01, Function | SmallTest | Level2)
528 {
529     SessionInfo info;
530     sptr<SceneSession> subSession = sptr<SceneSession>::MakeSptr(info, nullptr);
531     sptr<MainSession> mainSession = sptr<MainSession>::MakeSptr(info, nullptr);
532 
533     bool isCall = false;
__anon6f268c810802(const WSRect& rect, bool isGlobal, bool needFlush) 534     auto task = [&isCall](const WSRect& rect, bool isGlobal, bool needFlush) {
535         isCall = true;
536     };
537     mainSession->RegisterNotifySurfaceBoundsChangeFunc(subSession->GetPersistentId(), std::move(task));
538     ASSERT_NE(nullptr, mainSession->notifySurfaceBoundsChangeFuncMap_[subSession->GetPersistentId()]);
539 
540     WSRect rect;
541     subSession->isFollowParentLayout_ = false;
542     mainSession->NotifySubAndDialogFollowRectChange(rect, false, false);
543     ASSERT_EQ(false, isCall);
544 
545     subSession->isFollowParentLayout_ = true;
546     sptr<SceneSession::SpecificSessionCallback> callBack = sptr<SceneSession::SpecificSessionCallback>::MakeSptr();
547     mainSession->specificCallback_ = callBack;
__anon6f268c810902(int32_t persistentId) 548     auto getSessionCallBack = [&subSession](int32_t persistentId) {
549         return subSession;
550     };
551     callBack->onGetSceneSessionByIdCallback_ = getSessionCallBack;
552     mainSession->NotifySubAndDialogFollowRectChange(rect, false, false);
553     ASSERT_EQ(true, isCall);
554 }
555 }
556 }
557 }