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 #include <gtest/gtest.h>
16 
17 #include "display_manager.h"
18 #include "input_event.h"
19 #include "key_event.h"
20 #include "mock/mock_session_stage.h"
21 #include "pointer_event.h"
22 
23 #include "session/host/include/main_session.h"
24 #include "session/host/include/keyboard_session.h"
25 #include "session/host/include/scene_session.h"
26 #include "session/host/include/sub_session.h"
27 #include "session/host/include/system_session.h"
28 #include "window_helper.h"
29 #include "wm_common.h"
30 
31 
32 using namespace testing;
33 using namespace testing::ext;
34 namespace OHOS {
35 namespace Rosen {
36 class SceneSessionTest3 : public testing::Test {
37 public:
38     static void SetUpTestCase();
39     static void TearDownTestCase();
40     void SetUp() override;
41     void TearDown() override;
42 };
43 
SetUpTestCase()44 void SceneSessionTest3::SetUpTestCase()
45 {
46 }
47 
TearDownTestCase()48 void SceneSessionTest3::TearDownTestCase()
49 {
50 }
51 
SetUp()52 void SceneSessionTest3::SetUp()
53 {
54 }
55 
TearDown()56 void SceneSessionTest3::TearDown()
57 {
58 }
59 
60 namespace {
61 
62 /**
63  * @tc.name: SetAspectRatio11
64  * @tc.desc: normal function
65  * @tc.type: FUNC
66  */
67 HWTEST_F(SceneSessionTest3, SetAspectRatio1, Function | SmallTest | Level2)
68 {
69     SessionInfo info;
70     info.abilityName_ = "SetAspectRatio11";
71     info.bundleName_ = "SetAspectRatio11";
72     sptr<SceneSession::SpecificSessionCallback> specificCallback_ =
73         new (std::nothrow) SceneSession::SpecificSessionCallback();
74     EXPECT_NE(specificCallback_, nullptr);
75     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
76     EXPECT_NE(scensession, nullptr);
77     scensession->isActive_ = true;
78     scensession->property_ = nullptr;
79     float ratio = 0.0001;
80     auto result = scensession->SetAspectRatio(ratio);
81     ASSERT_EQ(result, WSError::WS_ERROR_NULLPTR);
82 }
83 
84 
85 /**
86  * @tc.name: SetAspectRatio12
87  * @tc.desc: normal function
88  * @tc.type: FUNC
89  */
90 HWTEST_F(SceneSessionTest3, SetAspectRatio12, Function | SmallTest | Level2)
91 {
92     SessionInfo info;
93     info.abilityName_ = "SetAspectRatio12";
94     info.bundleName_ = "SetAspectRatio12";
95     sptr<SceneSession::SpecificSessionCallback> specificCallback_ =
96         new (std::nothrow) SceneSession::SpecificSessionCallback();
97     EXPECT_NE(specificCallback_, nullptr);
98     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
99     EXPECT_NE(scensession, nullptr);
100     scensession->isActive_ = true;
101 
102     float ratio = 0.0001;
103     scensession->moveDragController_ = nullptr;
104     auto result = scensession->SetAspectRatio(ratio);
105     ASSERT_EQ(result, WSError::WS_OK);
106     scensession->moveDragController_ = new (std::nothrow) MoveDragController(0);
107     result = scensession->SetAspectRatio(ratio);
108     ASSERT_EQ(result, WSError::WS_OK);
109 
110     sptr<WindowSessionProperty> property = new(std::nothrow) WindowSessionProperty();
111     EXPECT_NE(property, nullptr);
112     property->SetWindowType(WindowType::APP_MAIN_WINDOW_BASE);
113     scensession->SetSessionProperty(property);
114     result = scensession->SetAspectRatio(ratio);
115     ASSERT_EQ(result, WSError::WS_OK);
116 }
117 
118 /**
119  * @tc.name: SetAspectRatio15
120  * @tc.desc: normal function
121  * @tc.type: FUNC
122  */
123 HWTEST_F(SceneSessionTest3, SetAspectRatio15, Function | SmallTest | Level2)
124 {
125     SessionInfo info;
126     info.abilityName_ = "SetAspectRatio15";
127     info.bundleName_ = "SetAspectRatio15";
128     sptr<SceneSession::SpecificSessionCallback> specificCallback_ =
129         new (std::nothrow) SceneSession::SpecificSessionCallback();
130     EXPECT_NE(specificCallback_, nullptr);
131     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
132     EXPECT_NE(scensession, nullptr);
133     scensession->isActive_ = true;
134 
135     float ratio = 0.1;
136     sptr<WindowSessionProperty> property = new(std::nothrow) WindowSessionProperty();
137     EXPECT_NE(property, nullptr);
138     property->SetWindowType(WindowType::APP_MAIN_WINDOW_BASE);
139     scensession->SetSessionProperty(property);
140     WindowLimits limits;
141     limits.maxHeight_ = 10;
142     limits.minWidth_ = 0;
143     property->SetWindowLimits(limits);
144     scensession->SetAspectRatio(ratio);
145 
146     limits.maxHeight_ = 0;
147     limits.minWidth_ = 10;
148     property->SetWindowLimits(limits);
149     scensession->SetAspectRatio(ratio);
150     EXPECT_NE(scensession, nullptr);
151 }
152 
153 /**
154  * @tc.name: SetAspectRatio8
155  * @tc.desc: normal function
156  * @tc.type: FUNC
157  */
158 HWTEST_F(SceneSessionTest3, SetAspectRatio8, Function | SmallTest | Level2)
159 {
160     SessionInfo info;
161     info.abilityName_ = "SetAspectRatio8";
162     info.bundleName_ = "SetAspectRatio8";
163     sptr<SceneSession::SpecificSessionCallback> specificCallback_ =
164         new (std::nothrow) SceneSession::SpecificSessionCallback();
165     EXPECT_NE(specificCallback_, nullptr);
166     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
167     EXPECT_NE(scensession, nullptr);
168     scensession->isActive_ = true;
169     sptr<WindowSessionProperty> property = new(std::nothrow) WindowSessionProperty();
170     EXPECT_NE(property, nullptr);
171     property->SetWindowType(WindowType::APP_MAIN_WINDOW_BASE);
172     scensession->SetSessionProperty(property);
173 
174     float ratio = 0.1;
175     WindowLimits limits;
176     limits.maxHeight_ = 10;
177     limits.minWidth_ = 10;
178     property->SetWindowLimits(limits);
179     auto result = scensession->SetAspectRatio(ratio);
180 
181     ratio = 10;
182     result = scensession->SetAspectRatio(ratio);
183     ASSERT_EQ(result, WSError::WS_OK);
184 }
185 
186 /**
187  * @tc.name: UpdateRect1
188  * @tc.desc: normal function
189  * @tc.type: FUNC
190  */
191 HWTEST_F(SceneSessionTest3, UpdateRect1, Function | SmallTest | Level2)
192 {
193     SessionInfo info;
194     info.abilityName_ = "UpdateRect1";
195     info.bundleName_ = "UpdateRect1";
196     sptr<SceneSession::SpecificSessionCallback> specificCallback_ =
197         new (std::nothrow) SceneSession::SpecificSessionCallback();
198     EXPECT_NE(specificCallback_, nullptr);
199     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
200     EXPECT_NE(scensession, nullptr);
201     scensession->isActive_ = true;
202 
203     sptr<WindowSessionProperty> property = new(std::nothrow) WindowSessionProperty();
204     EXPECT_NE(property, nullptr);
205     property->SetWindowType(WindowType::APP_MAIN_WINDOW_BASE);
206 
207     scensession->SetSessionProperty(property);
208     WSRect rect({1, 1, 1, 1});
209     SizeChangeReason reason = SizeChangeReason::UNDEFINED;
210     WSError result = scensession->UpdateRect(rect, reason, "SceneSessionTest3");
211     ASSERT_EQ(result, WSError::WS_OK);
212 
213     scensession->winRect_ = rect;
214     result = scensession->UpdateRect(rect, reason, "SceneSessionTest3");
215     ASSERT_EQ(result, WSError::WS_OK);
216 
217     scensession->reason_ = SizeChangeReason::DRAG_END;
218     result = scensession->UpdateRect(rect, reason, "SceneSessionTest3");
219     ASSERT_EQ(result, WSError::WS_OK);
220 
221     WSRect rect2({0, 0, 0, 0});
222     result = scensession->UpdateRect(rect2, reason, "SceneSessionTest3");
223     ASSERT_EQ(result, WSError::WS_OK);
224 }
225 
226 /**
227  * @tc.name: FixKeyboardPositionByKeyboardPanel
228  * @tc.desc: normal function
229  * @tc.type: FUNC
230  */
231 HWTEST_F(SceneSessionTest3, FixKeyboardPositionByKeyboardPanel, Function | SmallTest | Level2)
232 {
233     SessionInfo info;
234     info.abilityName_ = "FixKeyboardPositionByKeyboardPanel";
235     info.bundleName_ = "FixKeyboardPositionByKeyboardPanel";
236     sptr<SceneSession::SpecificSessionCallback> specificCallback_ =
237         new (std::nothrow) SceneSession::SpecificSessionCallback();
238     EXPECT_NE(specificCallback_, nullptr);
239     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
240     EXPECT_NE(scensession, nullptr);
241     scensession->isActive_ = true;
242 
243     sptr<WindowSessionProperty> property = new(std::nothrow) WindowSessionProperty();
244     EXPECT_NE(property, nullptr);
245     property->SetWindowType(WindowType::APP_MAIN_WINDOW_BASE);
246 
247     scensession->SetSessionProperty(property);
248     scensession->FixKeyboardPositionByKeyboardPanel(nullptr, nullptr);
249     ASSERT_NE(scensession, nullptr);
250 }
251 
252 /**
253  * @tc.name: FixKeyboardPositionByKeyboardPanel1
254  * @tc.desc: normal function
255  * @tc.type: FUNC
256  */
257 HWTEST_F(SceneSessionTest3, FixKeyboardPositionByKeyboardPanel1, Function | SmallTest | Level2)
258 {
259     SessionInfo info;
260     info.abilityName_ = "FixKeyboardPositionByKeyboardPanel1";
261     info.bundleName_ = "FixKeyboardPositionByKeyboardPanel1";
262     sptr<SceneSession::SpecificSessionCallback> specificCallback_ =
263         new (std::nothrow) SceneSession::SpecificSessionCallback();
264     EXPECT_NE(specificCallback_, nullptr);
265     sptr<SceneSession> scenceSession = new (std::nothrow) SceneSession(info, nullptr);
266     EXPECT_NE(scenceSession, nullptr);
267     scenceSession->isActive_ = true;
268 
269     sptr<WindowSessionProperty> property = new(std::nothrow) WindowSessionProperty();
270     EXPECT_NE(property, nullptr);
271     property->SetWindowType(WindowType::APP_MAIN_WINDOW_BASE);
272 
273     scenceSession->SetSessionProperty(property);
274     scenceSession->FixKeyboardPositionByKeyboardPanel(scenceSession, scenceSession);
275     ASSERT_NE(scenceSession, nullptr);
276 
277     sptr<KeyboardSession> keyboardSession = new (std::nothrow) KeyboardSession(info, nullptr, nullptr);
278     ASSERT_NE(keyboardSession, nullptr);
279     property->keyboardLayoutParams_.gravity_ = WindowGravity::WINDOW_GRAVITY_FLOAT;
280     scenceSession->FixKeyboardPositionByKeyboardPanel(scenceSession, keyboardSession);
281 }
282 
283 /**
284  * @tc.name: NotifyClientToUpdateRectTask
285  * @tc.desc: normal function
286  * @tc.type: FUNC
287  */
288 HWTEST_F(SceneSessionTest3, NotifyClientToUpdateRectTask, Function | SmallTest | Level2)
289 {
290     SessionInfo info;
291     info.abilityName_ = "NotifyClientToUpdateRectTask";
292     info.bundleName_ = "NotifyClientToUpdateRectTask";
293     sptr<SceneSession> sceneSession = new (std::nothrow) SceneSession(info, nullptr);
294     EXPECT_NE(sceneSession, nullptr);
295     sceneSession->isActive_ = true;
296 
297     sptr<WindowSessionProperty> property = new (std::nothrow) WindowSessionProperty();
298     EXPECT_NE(property, nullptr);
299     property->SetWindowType(WindowType::APP_MAIN_WINDOW_BASE);
300 
301     sceneSession->SetSessionProperty(property);
302     auto result = sceneSession->NotifyClientToUpdateRectTask("SceneSessionTest3", nullptr);
303     ASSERT_NE(result, WSError::WS_OK);
304 
305     property->SetWindowType(WindowType::WINDOW_TYPE_KEYBOARD_PANEL);
306     sceneSession->SetSessionProperty(property);
307     sceneSession->isKeyboardPanelEnabled_ = true;
308     sceneSession->state_ = SessionState::STATE_FOREGROUND;
309     sceneSession->isScbCoreEnabled_ = false;
310     ASSERT_EQ(WSError::WS_OK,
311         sceneSession->NotifyClientToUpdateRectTask("SceneSessionTest3", nullptr));
312 
313     property->SetWindowType(WindowType::WINDOW_TYPE_KEYBOARD_PANEL);
314     sceneSession->SetSessionProperty(property);
315     sceneSession->isKeyboardPanelEnabled_ = true;
316     ASSERT_EQ(WSError::WS_OK, sceneSession->NotifyClientToUpdateRectTask("SceneSessionTest3", nullptr));
317 
318     std::shared_ptr<RSTransaction> rs;
319     ASSERT_EQ(WSError::WS_OK, sceneSession->NotifyClientToUpdateRectTask("SceneSessionTest3", rs));
320 }
321 
322 /**
323  * @tc.name: BindDialogSessionTarget1
324  * @tc.desc: normal function
325  * @tc.type: FUNC
326  */
327 HWTEST_F(SceneSessionTest3, BindDialogSessionTarget1, Function | SmallTest | Level2)
328 {
329     SessionInfo info;
330     info.abilityName_ = "BindDialogSessionTarget1";
331     info.bundleName_ = "BindDialogSessionTarget1";
332     sptr<SceneSession::SpecificSessionCallback> specificCallback_ =
333         new (std::nothrow) SceneSession::SpecificSessionCallback();
334     EXPECT_NE(specificCallback_, nullptr);
335     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
336     EXPECT_NE(scensession, nullptr);
337     scensession->isActive_ = true;
338 
339     sptr<WindowSessionProperty> property = new(std::nothrow) WindowSessionProperty();
340     EXPECT_NE(property, nullptr);
341     property->SetWindowType(WindowType::WINDOW_TYPE_INPUT_METHOD_FLOAT);
342     property->keyboardLayoutParams_.gravity_ = WindowGravity::WINDOW_GRAVITY_BOTTOM;
343     scensession->SetSessionProperty(property);
344 
345     sptr<SceneSession> sceneSession = nullptr;
346     WSError result = scensession->BindDialogSessionTarget(sceneSession);
347     ASSERT_EQ(result, WSError::WS_ERROR_NULLPTR);
348 
349     scensession->sessionChangeCallback_ = nullptr;
350     sptr<SceneSession> sceneSession1 = scensession;
351     result = scensession->BindDialogSessionTarget(sceneSession1);
352     ASSERT_EQ(result, WSError::WS_OK);
353 
354     sceneSession1->sessionChangeCallback_ = new (std::nothrow) MainSession::SessionChangeCallback();
355     EXPECT_NE(sceneSession1->sessionChangeCallback_, nullptr);
__anon5be19e550202(const sptr<SceneSession>&) 356     sceneSession1->sessionChangeCallback_->onBindDialogTarget_ = [](const sptr<SceneSession>&) {};
357     result = scensession->BindDialogSessionTarget(sceneSession1);
358     ASSERT_EQ(result, WSError::WS_OK);
359 }
360 
361 /**
362  * @tc.name: ClearSpecificSessionCbMap1
363  * @tc.desc: normal function
364  * @tc.type: FUNC
365  */
366 HWTEST_F(SceneSessionTest3, ClearSpecificSessionCbMap1, Function | SmallTest | Level2)
367 {
368     SessionInfo info;
369     info.abilityName_ = "ClearSpecificSessionCbMap1";
370     info.bundleName_ = "ClearSpecificSessionCbMap1";
371     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
372     EXPECT_NE(nullptr, scensession);
373     scensession->ClearSpecificSessionCbMap();
374 
375     sptr<MainSession::SessionChangeCallback> sessionChangeCallback =
376         new (std::nothrow) MainSession::SessionChangeCallback();
__anon5be19e550302(bool, int32_t) 377     scensession->clearCallbackMapFunc_ = [](bool, int32_t) {};
378     scensession->sessionChangeCallback_ = sessionChangeCallback;
379     scensession->ClearSpecificSessionCbMap();
380 }
381 
382 /**
383  * @tc.name: IsMovableWindowType
384  * @tc.desc: normal function
385  * @tc.type: FUNC
386  */
387 HWTEST_F(SceneSessionTest3, IsMovableWindowType, Function | SmallTest | Level2)
388 {
389     SessionInfo info;
390     info.abilityName_ = "IsMovableWindowType";
391     info.bundleName_ = "IsMovableWindowType";
392     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
393     EXPECT_NE(nullptr, scensession);
394 
395     scensession->property_ = nullptr;
396     EXPECT_EQ(scensession->IsMovableWindowType(), false);
397 }
398 
399 /**
400  * @tc.name: SetBlankFlag
401  * @tc.desc: check func SetBlankFlag
402  * @tc.type: FUNC
403  */
404 HWTEST_F(SceneSessionTest3, SetBlankFlag, Function | SmallTest | Level2)
405 {
406     SessionInfo info;
407     info.abilityName_ = "SetBlankFlag";
408     info.bundleName_ = "SetBlankFlag";
409     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
410     EXPECT_NE(nullptr, scensession);
411 
412     bool isAddBlank = true;
413     scensession->SetBlankFlag(isAddBlank);
414     ASSERT_EQ(isAddBlank, scensession->GetBlankFlag());
415 }
416 
417 /**
418  * @tc.name: GetBlankFlag
419  * @tc.desc: check func GetBlankFlag
420  * @tc.type: FUNC
421  */
422 HWTEST_F(SceneSessionTest3, GetBlankFlag, Function | SmallTest | Level2)
423 {
424     SessionInfo info;
425     info.abilityName_ = "GetBlankFlag";
426     info.bundleName_ = "GetBlankFlag";
427     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
428     EXPECT_NE(nullptr, scensession);
429 
430     bool isAddBlank = true;
431     scensession->SetBlankFlag(isAddBlank);
432     ASSERT_EQ(isAddBlank, scensession->GetBlankFlag());
433 }
434 
435 /**
436  * @tc.name: SetBufferAvailableCallbackEnable
437  * @tc.desc: check func SetBufferAvailableCallbackEnable
438  * @tc.type: FUNC
439  */
440 HWTEST_F(SceneSessionTest3, SetBufferAvailableCallbackEnable, Function | SmallTest | Level2)
441 {
442     SessionInfo info;
443     info.abilityName_ = "SetBufferAvailableCallbackEnable";
444     info.bundleName_ = "SetBufferAvailableCallbackEnable";
445     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
446     EXPECT_NE(nullptr, scensession);
447 
448     bool enable = true;
449     scensession->SetBufferAvailableCallbackEnable(enable);
450     ASSERT_EQ(enable, scensession->GetBufferAvailableCallbackEnable());
451 }
452 
453 /**
454  * @tc.name: GetBufferAvailableCallbackEnable
455  * @tc.desc: check func GetBufferAvailableCallbackEnable
456  * @tc.type: FUNC
457  */
458 HWTEST_F(SceneSessionTest3, GetBufferAvailableCallbackEnable, Function | SmallTest | Level2)
459 {
460     SessionInfo info;
461     info.abilityName_ = "GetBufferAvailableCallbackEnable";
462     info.bundleName_ = "GetBufferAvailableCallbackEnable";
463     sptr<SceneSession> scensession = new (std::nothrow) SceneSession(info, nullptr);
464     EXPECT_NE(nullptr, scensession);
465 
466     bool enable = true;
467     scensession->SetBufferAvailableCallbackEnable(enable);
468     ASSERT_EQ(enable, scensession->GetBufferAvailableCallbackEnable());
469 }
470 
471 /**
472  * @tc.name: UpdateScaleInner
473  * @tc.desc: check func UpdateScaleInner
474  * @tc.type: FUNC
475  */
476 HWTEST_F(SceneSessionTest3, UpdateScaleInner, Function | SmallTest | Level2)
477 {
478     SessionInfo info;
479     info.abilityName_ = "UpdateScaleInner";
480     info.bundleName_ = "UpdateScaleInner";
481     sptr<SceneSession> sceneSession = sptr<SceneSession>::MakeSptr(info, nullptr);
482     EXPECT_NE(nullptr, sceneSession);
483 
484     sceneSession->sessionStage_ = nullptr;
485     sceneSession->state_ = SessionState::STATE_FOREGROUND;
486     bool res = sceneSession->UpdateScaleInner(10.0f, 10.0f, 10.0f, 10.0f);
487     EXPECT_EQ(true, res);
488 
489     res = sceneSession->UpdateScaleInner(10.0f, 9.0f, 10.0f, 10.0f);
490     res = sceneSession->UpdateScaleInner(10.0f, 9.0f, 9.0f, 10.0f);
491     res = sceneSession->UpdateScaleInner(10.0f, 9.0f, 9.0f, 9.0f);
492     EXPECT_EQ(true, res);
493 
494     sceneSession->state_ = SessionState::STATE_BACKGROUND;
495     res = sceneSession->UpdateScaleInner(10.0f, 9.0f, 9.0f, 9.0f);
496     EXPECT_EQ(false, res);
497 
498     sceneSession->state_ = SessionState::STATE_FOREGROUND;
499     sptr<SessionStageMocker> mockSessionStage = sptr<SessionStageMocker>::MakeSptr();
500     ASSERT_NE(mockSessionStage, nullptr);
501     sceneSession->sessionStage_ = mockSessionStage;
502     res = sceneSession->UpdateScaleInner(1.0f, 2.0f, 3.0f, 4.0f);
503     EXPECT_EQ(true, res);
504     res = sceneSession->UpdateScaleInner(1.0f, 2.0f, 3.0f, 4.0f);
505     EXPECT_EQ(false, res);
506 }
507 
508 /**
509  * @tc.name: SetWindowRectAutoSaveCallback
510  * @tc.desc: SetWindowRectAutoSaveCallback
511  * @tc.type: FUNC
512  */
513 HWTEST_F(SceneSessionTest3, SetWindowRectAutoSaveCallback, Function | SmallTest | Level2)
514 {
515     SessionInfo info;
516     info.abilityName_ = "SetWindowRectAutoSaveCallback";
517     info.bundleName_ = "SetWindowRectAutoSaveCallback";
518     sptr<SceneSession> sceneSession = sptr<SceneSession>::MakeSptr(info, nullptr);
519     sptr<WindowSessionProperty> windowSessionProperty = sptr<WindowSessionProperty>::MakeSptr();
520     sceneSession->property_ = windowSessionProperty;
521 
__anon5be19e550402(bool enabled) 522     NotifySetWindowRectAutoSaveFunc func1 = [](bool enabled) {
523         return;
524     };
525     sceneSession->SetWindowRectAutoSaveCallback(std::move(func1));
526     ASSERT_NE(nullptr, sceneSession->onSetWindowRectAutoSaveFunc_);
527 }
528 }
529 }
530 }