1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include <gtest/gtest.h>
17 #include <transaction/rs_transaction.h>
18 #include "iremote_object_mocker.h"
19 #include "display_group_controller.h"
20 #include "display_manager.h"
21 #include "window_helper.h"
22 #include "window_node_container.h"
23 
24 using namespace testing;
25 using namespace testing::ext;
26 
27 namespace OHOS {
28 namespace Rosen {
29 namespace {
30 const Rect DEFAULT_RECT = {0, 0, 200, 200};
31 }
32 class DisplayGroupControllerTest : public testing::Test {
33 public:
34     static void SetUpTestCase();
35     static void TearDownTestCase();
36     void SetUp() override;
37     void TearDown() override;
38     sptr<WindowProperty> CreateWindowProperty(uint32_t windowId,
39         WindowType type = WindowType::WINDOW_TYPE_APP_MAIN_WINDOW);
40     static void SetDisplayGroupInfo(DisplayId displayId, Rect displayRect);
41 private:
42     static sptr<WindowNodeContainer> container_;
43     static DisplayGroupInfo& displayGroupInfo_;
44     static sptr<DisplayGroupController> displayGroupController_;
45 };
46 
47 sptr<WindowNodeContainer> DisplayGroupControllerTest::container_ = nullptr;
48 DisplayGroupInfo& DisplayGroupControllerTest::displayGroupInfo_ = DisplayGroupInfo::GetInstance();
49 sptr<DisplayGroupController> DisplayGroupControllerTest::displayGroupController_ = nullptr;
50 
SetUpTestCase()51 void DisplayGroupControllerTest::SetUpTestCase()
52 {
53     auto display = DisplayManager::GetInstance().GetDefaultDisplay();
54     ASSERT_TRUE((display != nullptr));
55     container_ = new WindowNodeContainer(display->GetDisplayInfo(), display->GetScreenId());
56     displayGroupController_ = container_->displayGroupController_;
57 
58     DisplayGroupInfo::GetInstance().Init(0, display->GetDisplayInfo());
59 }
60 
TearDownTestCase()61 void DisplayGroupControllerTest::TearDownTestCase()
62 {
63     container_ = nullptr;
64     displayGroupController_ = nullptr;
65 }
66 
SetUp()67 void DisplayGroupControllerTest::SetUp()
68 {
69     DisplayId defaultId = 0;
70     displayGroupController_->displayGroupWindowTree_.clear();
71     displayGroupController_->InitNewDisplay(defaultId);
72     SetDisplayGroupInfo(0, DEFAULT_RECT);
73 }
74 
TearDown()75 void DisplayGroupControllerTest::TearDown()
76 {
77     displayGroupController_->defaultDisplayId_ = 0;
78     container_->GetLayoutPolicy()->isMultiDisplay_ = false;
79     displayGroupController_->ClearMapOfDestroyedDisplay(0);
80     displayGroupController_->ClearMapOfDestroyedDisplay(1);
81 }
82 
CreateWindowProperty(uint32_t windowId, WindowType type)83 sptr<WindowProperty> DisplayGroupControllerTest::CreateWindowProperty(uint32_t windowId, WindowType type)
84 {
85     sptr<WindowProperty> property = new WindowProperty();
86     property->SetWindowId(windowId);
87     property->SetWindowType(type);
88     return property;
89 }
90 
SetDisplayGroupInfo(DisplayId displayId, Rect displayRect)91 void DisplayGroupControllerTest::SetDisplayGroupInfo(DisplayId displayId, Rect displayRect)
92 {
93     sptr<DisplayInfo> displayInfo = new DisplayInfo();
94     displayInfo->SetDisplayId(displayId);
95     displayInfo->SetOffsetX(displayRect.posX_);
96     displayInfo->SetOffsetY(displayRect.posY_);
97     displayInfo->SetWidth(displayRect.width_);
98     displayInfo->SetHeight(displayRect.height_);
99     displayGroupInfo_.displayInfosMap_[displayId] = displayInfo;
100     displayGroupInfo_.leftDisplayId_ = 0;
101     displayGroupInfo_.rightDisplayId_ = 1;
102 }
103 
104 namespace {
105 /**
106  * @tc.name: GetWindowNodesByDisplayIdAndRootType01
107  * @tc.desc: Use displayId which not exists
108  * @tc.type: FUNC
109  */
HWTEST_F(DisplayGroupControllerTest, GetWindowNodesByDisplayIdAndRootType01, Function | SmallTest | Level2)110 HWTEST_F(DisplayGroupControllerTest, GetWindowNodesByDisplayIdAndRootType01, Function | SmallTest | Level2)
111 {
112     DisplayId testId = 100; // 100 test display id
113     std::vector<sptr<WindowNode>>* rootNodeVectorPtr =
114         displayGroupController_->GetWindowNodesByDisplayIdAndRootType(testId, WindowRootNodeType::APP_WINDOW_NODE);
115     ASSERT_EQ(nullptr, rootNodeVectorPtr);
116 }
117 
118 /**
119  * @tc.name: GetWindowNodesByDisplayIdAndRootType02
120  * @tc.desc: Use WindowRootNodeType which not exists
121  * @tc.type: FUNC
122  */
HWTEST_F(DisplayGroupControllerTest, GetWindowNodesByDisplayIdAndRootType02, Function | SmallTest | Level2)123 HWTEST_F(DisplayGroupControllerTest, GetWindowNodesByDisplayIdAndRootType02, Function | SmallTest | Level2)
124 {
125     WindowRootNodeType rootType = static_cast<WindowRootNodeType>(100);
126     std::vector<sptr<WindowNode>>* rootNodeVectorPtr =
127         displayGroupController_->GetWindowNodesByDisplayIdAndRootType(0, rootType);
128     ASSERT_EQ(nullptr, rootNodeVectorPtr);
129 }
130 
131 /**
132  * @tc.name: AddWindowNodeOnWindowTree01
133  * @tc.desc: Use WindowRootNodeType which not exists
134  * @tc.type: FUNC
135  */
HWTEST_F(DisplayGroupControllerTest, AddWindowNodeOnWindowTree01, Function | SmallTest | Level2)136 HWTEST_F(DisplayGroupControllerTest, AddWindowNodeOnWindowTree01, Function | SmallTest | Level2)
137 {
138     sptr<WindowNode> node1 = new WindowNode();
139     node1->SetWindowProperty(CreateWindowProperty(100));
140     ASSERT_NE(nullptr, node1);
141     WindowRootNodeType rootType = static_cast<WindowRootNodeType>(100);
142     displayGroupController_->AddWindowNodeOnWindowTree(node1, rootType);
143 }
144 
145 /**
146  * @tc.name: UpdateDisplayGroupWindowTree01
147  * @tc.desc: Use appWindowNode with nullptr
148  * @tc.type: FUNC
149  */
HWTEST_F(DisplayGroupControllerTest, UpdateDisplayGroupWindowTree01, Function | SmallTest | Level2)150 HWTEST_F(DisplayGroupControllerTest, UpdateDisplayGroupWindowTree01, Function | SmallTest | Level2)
151 {
152     auto originRootNode = container_->GetRootNode(WindowRootNodeType::APP_WINDOW_NODE);
153     ASSERT_NE(nullptr, originRootNode);
154     container_->appWindowNode_ = nullptr;
155     ASSERT_EQ(nullptr, container_->GetRootNode(WindowRootNodeType::APP_WINDOW_NODE));
156     displayGroupController_->UpdateDisplayGroupWindowTree();
157     container_->appWindowNode_ = originRootNode;
158     displayGroupController_->UpdateDisplayGroupWindowTree();
159 }
160 
161 
162 /**
163  * @tc.name: ProcessCrossNodes02
164  * @tc.desc: IsShowingOnMultiDisplays_ is true with different DisplayStateChangeType
165  * @tc.type: FUNC
166  */
HWTEST_F(DisplayGroupControllerTest, ProcessCrossNodes02, Function | SmallTest | Level2)167 HWTEST_F(DisplayGroupControllerTest, ProcessCrossNodes02, Function | SmallTest | Level2)
168 {
169     sptr<WindowNode> node1 = new WindowNode();
170     node1->SetWindowProperty(CreateWindowProperty(100));
171     ASSERT_NE(nullptr, node1);
172     sptr<WindowNode> child = new WindowNode();
173     child->SetWindowProperty(CreateWindowProperty(101));
174     ASSERT_NE(nullptr, child);
175     node1->children_.push_back(child);
176     node1->isShowingOnMultiDisplays_ = true;
177     std::vector<sptr<WindowNode>>* rootApp = displayGroupController_->GetWindowNodesByDisplayIdAndRootType(
178         0, WindowRootNodeType::APP_WINDOW_NODE);
179     rootApp->push_back(node1);
180     displayGroupController_->ProcessCrossNodes(1, DisplayStateChangeType::SIZE_CHANGE);
181 }
182 
183 /**
184  * @tc.name: ProcessCrossNodes03
185  * @tc.desc: IsShowingOnMultiDisplays_ is true with different DisplayStateChangeType
186  * @tc.type: FUNC
187  */
HWTEST_F(DisplayGroupControllerTest, ProcessCrossNodes03, Function | SmallTest | Level2)188 HWTEST_F(DisplayGroupControllerTest, ProcessCrossNodes03, Function | SmallTest | Level2)
189 {
190     sptr<WindowNode> node1 = new WindowNode();
191     node1->SetWindowProperty(CreateWindowProperty(100));
192     ASSERT_NE(nullptr, node1);
193     sptr<WindowNode> child = new WindowNode();
194     child->SetWindowProperty(CreateWindowProperty(101));
195     ASSERT_NE(nullptr, child);
196     node1->children_.push_back(child);
197     node1->isShowingOnMultiDisplays_ = true;
198     std::vector<sptr<WindowNode>>* rootApp = displayGroupController_->GetWindowNodesByDisplayIdAndRootType(
199         0, WindowRootNodeType::APP_WINDOW_NODE);
200     rootApp->push_back(node1);
201     displayGroupController_->ProcessCrossNodes(1, DisplayStateChangeType::UPDATE_ROTATION);
202 }
203 
204 /**
205  * @tc.name: ProcessCrossNodes04
206  * @tc.desc: IsShowingOnMultiDisplays_ is true with multi showing display
207  * @tc.type: FUNC
208  */
HWTEST_F(DisplayGroupControllerTest, ProcessCrossNodes04, Function | SmallTest | Level2)209 HWTEST_F(DisplayGroupControllerTest, ProcessCrossNodes04, Function | SmallTest | Level2)
210 {
211     sptr<WindowNode> node1 = new WindowNode();
212     node1->SetWindowProperty(CreateWindowProperty(100));
213     ASSERT_NE(nullptr, node1);
214     sptr<WindowNode> child = new WindowNode();
215     child->SetWindowProperty(CreateWindowProperty(101));
216     ASSERT_NE(nullptr, child);
217     node1->children_.push_back(child);
218     node1->isShowingOnMultiDisplays_ = true;
219     node1->SetShowingDisplays({0, 1});
220     std::vector<sptr<WindowNode>>* rootApp = displayGroupController_->GetWindowNodesByDisplayIdAndRootType(
221         0, WindowRootNodeType::APP_WINDOW_NODE);
222     rootApp->push_back(node1);
223     displayGroupController_->ProcessCrossNodes(1, DisplayStateChangeType::DISPLAY_COMPRESS);
224 }
225 
226 /**
227  * @tc.name: UpdateWindowShowingDisplays01
228  * @tc.desc: Show only on left display
229  * @tc.type: FUNC
230  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowShowingDisplays01, Function | SmallTest | Level2)231 HWTEST_F(DisplayGroupControllerTest, UpdateWindowShowingDisplays01, Function | SmallTest | Level2)
232 {
233     sptr<WindowNode> node1 = new WindowNode();
234     node1->SetWindowProperty(CreateWindowProperty(100));
235     ASSERT_NE(nullptr, node1);
236     sptr<WindowNode> child = new WindowNode();
237     child->SetWindowProperty(CreateWindowProperty(101));
238     ASSERT_NE(nullptr, child);
239     node1->children_.push_back(child);
240     node1->SetWindowRect({0, 0, 50, 50});
241     displayGroupController_->UpdateWindowShowingDisplays(node1);
242     ASSERT_EQ(1, node1->GetShowingDisplays().size());
243 }
244 
245 /**
246  * @tc.name: UpdateWindowShowingDisplays02
247  * @tc.desc: Not show on any display
248  * @tc.type: FUNC
249  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowShowingDisplays02, Function | SmallTest | Level2)250 HWTEST_F(DisplayGroupControllerTest, UpdateWindowShowingDisplays02, Function | SmallTest | Level2)
251 {
252     sptr<WindowNode> node1 = new WindowNode();
253     node1->SetWindowProperty(CreateWindowProperty(100));
254     ASSERT_NE(nullptr, node1);
255     sptr<WindowNode> child = new WindowNode();
256     child->SetWindowProperty(CreateWindowProperty(101));
257     ASSERT_NE(nullptr, child);
258     node1->children_.push_back(child);
259     node1->SetWindowRect({0, 0, 0, 0});
260     SetDisplayGroupInfo(0, {0, 0, 0, 0});
261     displayGroupController_->InitNewDisplay(1);
262     SetDisplayGroupInfo(1, {0, 0, 0, 0});
263     displayGroupController_->UpdateWindowShowingDisplays(node1);
264 }
265 
266 /**
267  * @tc.name: UpdateWindowShowingDisplays03
268  * @tc.desc: Show only on right display
269  * @tc.type: FUNC
270  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowShowingDisplays03, Function | SmallTest | Level2)271 HWTEST_F(DisplayGroupControllerTest, UpdateWindowShowingDisplays03, Function | SmallTest | Level2)
272 {
273     sptr<WindowNode> node1 = new WindowNode();
274     node1->SetWindowProperty(CreateWindowProperty(100));
275     ASSERT_NE(nullptr, node1);
276     sptr<WindowNode> child = new WindowNode();
277     child->SetWindowProperty(CreateWindowProperty(101));
278     ASSERT_NE(nullptr, child);
279     node1->children_.push_back(child);
280     node1->SetWindowRect({100, 100, 50, 50});
281     SetDisplayGroupInfo(0, {0, 0, 50, 50});
282     displayGroupController_->InitNewDisplay(1);
283     SetDisplayGroupInfo(1, {50, 50, 100, 100});
284     displayGroupController_->UpdateWindowShowingDisplays(node1);
285     ASSERT_EQ(1, node1->GetShowingDisplays().size());
286 }
287 
288 /**
289  * @tc.name: UpdateWindowShowingDisplays04
290  * @tc.desc: Show on multi display
291  * @tc.type: FUNC
292  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowShowingDisplays04, Function | SmallTest | Level2)293 HWTEST_F(DisplayGroupControllerTest, UpdateWindowShowingDisplays04, Function | SmallTest | Level2)
294 {
295     sptr<WindowNode> node1 = new WindowNode();
296     node1->SetWindowProperty(CreateWindowProperty(100));
297     ASSERT_NE(nullptr, node1);
298     sptr<WindowNode> child = new WindowNode();
299     child->SetWindowProperty(CreateWindowProperty(101));
300     ASSERT_NE(nullptr, child);
301     node1->children_.push_back(child);
302     node1->SetWindowRect({50, 50, 60, 60}); // 110 > 0 && 50 < 100
303     displayGroupController_->InitNewDisplay(0);
304     SetDisplayGroupInfo(0, {0, 0, 100, 100});
305     displayGroupController_->InitNewDisplay(1);
306     SetDisplayGroupInfo(1, {100, 100, 200, 200});
307     displayGroupController_->UpdateWindowShowingDisplays(node1);
308     ASSERT_EQ(2, node1->GetShowingDisplays().size());
309 }
310 
311 /**
312  * @tc.name: UpdateWindowDisplayIdIfNeeded01
313  * @tc.desc: Not show on any display
314  * @tc.type: FUNC
315  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded01, Function | SmallTest | Level2)316 HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded01, Function | SmallTest | Level2)
317 {
318     sptr<WindowNode> node1 = new WindowNode();
319     node1->SetWindowProperty(CreateWindowProperty(100));
320     ASSERT_NE(nullptr, node1);
321     node1->SetWindowRect({50, 50, 60, 60});
322     displayGroupController_->InitNewDisplay(0);
323     SetDisplayGroupInfo(0, {0, 0, 100, 100});
324     displayGroupController_->InitNewDisplay(1);
325     SetDisplayGroupInfo(1, {100, 100, 200, 200});
326     displayGroupController_->UpdateWindowDisplayIdIfNeeded(node1);
327     ASSERT_EQ(0, node1->GetShowingDisplays().size());
328 }
329 
330 /**
331  * @tc.name: UpdateWindowDisplayIdIfNeeded02
332  * @tc.desc: Show on left display
333  * @tc.type: FUNC
334  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded02, Function | SmallTest | Level2)335 HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded02, Function | SmallTest | Level2)
336 {
337     sptr<WindowNode> node1 = new WindowNode();
338     node1->SetWindowProperty(CreateWindowProperty(100));
339     ASSERT_NE(nullptr, node1);
340     node1->SetShowingDisplays({0});
341     node1->SetWindowRect({50, 50, 60, 60});
342     displayGroupController_->InitNewDisplay(0);
343     SetDisplayGroupInfo(0, {0, 0, 100, 100});
344     displayGroupController_->InitNewDisplay(1);
345     SetDisplayGroupInfo(1, {100, 100, 200, 200});
346     displayGroupController_->UpdateWindowDisplayIdIfNeeded(node1);
347     ASSERT_EQ(0, node1->GetDisplayId());
348 }
349 
350 /**
351  * @tc.name: UpdateWindowDisplayIdIfNeeded03
352  * @tc.desc: Window covers whole display region
353  * @tc.type: FUNC
354  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded03, Function | SmallTest | Level2)355 HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded03, Function | SmallTest | Level2)
356 {
357     sptr<WindowNode> node1 = new WindowNode();
358     node1->SetWindowProperty(CreateWindowProperty(100));
359     ASSERT_NE(nullptr, node1);
360     node1->SetShowingDisplays({0, 1});
361     node1->SetWindowRect({-50, -50, 200, 200});
362     displayGroupController_->InitNewDisplay(0);
363     SetDisplayGroupInfo(0, {0, 0, 100, 100});
364     displayGroupController_->InitNewDisplay(1);
365     SetDisplayGroupInfo(1, {200, 200, 200, 200});
366     displayGroupController_->UpdateWindowDisplayIdIfNeeded(node1);
367     ASSERT_EQ(0, node1->GetDisplayId());
368 }
369 
370 /**
371  * @tc.name: UpdateWindowDisplayIdIfNeeded04
372  * @tc.desc: Current display is default display
373  * @tc.type: FUNC
374  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded04, Function | SmallTest | Level2)375 HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded04, Function | SmallTest | Level2)
376 {
377     sptr<WindowNode> node1 = new WindowNode();
378     node1->SetWindowProperty(CreateWindowProperty(100));
379     ASSERT_NE(nullptr, node1);
380     node1->SetShowingDisplays({0, 1});
381     node1->SetWindowRect({50, 50, 100, 100});
382     displayGroupController_->InitNewDisplay(0);
383     SetDisplayGroupInfo(0, {0, 0, 100, 100});
384     displayGroupController_->InitNewDisplay(1);
385     SetDisplayGroupInfo(1, {200, 200, 200, 200});
386     displayGroupController_->UpdateWindowDisplayIdIfNeeded(node1);
387     ASSERT_EQ(0, node1->GetDisplayId());
388 }
389 
390 /**
391  * @tc.name: UpdateWindowDisplayIdIfNeeded05
392  * @tc.desc: Current display is expand display
393  * @tc.type: FUNC
394  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded05, Function | SmallTest | Level2)395 HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded05, Function | SmallTest | Level2)
396 {
397     sptr<WindowNode> node1 = new WindowNode();
398     node1->SetWindowProperty(CreateWindowProperty(100));
399     ASSERT_NE(nullptr, node1);
400     node1->SetShowingDisplays({0, 1});
401     node1->SetWindowRect({60, 60, 100, 100});
402     SetDisplayGroupInfo(0, {0, 0, 100, 100});
403     displayGroupController_->InitNewDisplay(1);
404     SetDisplayGroupInfo(1, {200, 200, 200, 200});
405     displayGroupController_->UpdateWindowDisplayIdIfNeeded(node1);
406     ASSERT_EQ(0, node1->GetDisplayId());
407 }
408 
409 /**
410  * @tc.name: UpdateWindowDisplayIdIfNeeded06
411  * @tc.desc: Current display is expand display
412  * @tc.type: FUNC
413  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded06, Function | SmallTest | Level2)414 HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayIdIfNeeded06, Function | SmallTest | Level2)
415 {
416     sptr<WindowNode> node1 = new WindowNode();
417     node1->SetWindowProperty(CreateWindowProperty(100));
418     ASSERT_NE(nullptr, node1);
419     node1->SetShowingDisplays({0, 1});
420     node1->SetWindowRect({60, 60, 120, 120});
421     SetDisplayGroupInfo(0, {0, 0, 70, 70});
422     displayGroupController_->InitNewDisplay(1);
423     SetDisplayGroupInfo(1, {70, 70, 200, 200});
424     displayGroupController_->UpdateWindowDisplayIdIfNeeded(node1);
425     ASSERT_EQ(1, node1->GetDisplayId());
426 }
427 
428 /**
429  * @tc.name: ChangeToRectInDisplayGroup01
430  * @tc.desc: Change to rect in Display Group
431  * @tc.type: FUNC
432  */
HWTEST_F(DisplayGroupControllerTest, ChangeToRectInDisplayGroup01, Function | SmallTest | Level2)433 HWTEST_F(DisplayGroupControllerTest, ChangeToRectInDisplayGroup01, Function | SmallTest | Level2)
434 {
435     sptr<WindowNode> node1 = new WindowNode();
436     node1->SetWindowProperty(CreateWindowProperty(100));
437     ASSERT_NE(nullptr, node1);
438     displayGroupController_->ChangeToRectInDisplayGroup(node1, 0);
439     Rect actualRect = node1->GetRequestRect();
440     Rect expectRect = {DEFAULT_RECT.posX_, DEFAULT_RECT.posY_, 0, 0};
441     ASSERT_EQ(expectRect, actualRect);
442 }
443 
444 /**
445  * @tc.name: PreProcessWindowNode01
446  * @tc.desc: PreProcessWindowNode with child
447  * @tc.type: FUNC
448  */
HWTEST_F(DisplayGroupControllerTest, PreProcessWindowNode01, Function | SmallTest | Level2)449 HWTEST_F(DisplayGroupControllerTest, PreProcessWindowNode01, Function | SmallTest | Level2)
450 {
451     sptr<WindowNode> node1 = new WindowNode();
452     node1->SetWindowProperty(CreateWindowProperty(100));
453     ASSERT_NE(nullptr, node1);
454     sptr<WindowNode> child = new WindowNode();
455     child->SetWindowProperty(CreateWindowProperty(101));
456     ASSERT_NE(nullptr, child);
457     node1->children_.push_back(child);
458     displayGroupController_->PreProcessWindowNode(node1, WindowUpdateType::WINDOW_UPDATE_ADDED);
459     Rect actualRect = node1->GetRequestRect();
460     Rect expectRect = {DEFAULT_RECT.posX_, DEFAULT_RECT.posY_, 0, 0};
461     ASSERT_EQ(expectRect, actualRect);
462 }
463 
464 /**
465  * @tc.name: PreProcessWindowNode02
466  * @tc.desc: PreProcessWindowNode with WINDOW_UPDATE_ACTIVE, and size change reason undefined
467  * @tc.type: FUNC
468  */
HWTEST_F(DisplayGroupControllerTest, PreProcessWindowNode02, Function | SmallTest | Level2)469 HWTEST_F(DisplayGroupControllerTest, PreProcessWindowNode02, Function | SmallTest | Level2)
470 {
471     sptr<WindowNode> node1 = new WindowNode();
472     node1->SetWindowProperty(CreateWindowProperty(100));
473     ASSERT_NE(nullptr, node1);
474     container_->GetLayoutPolicy()->isMultiDisplay_ = true;
475     displayGroupController_->PreProcessWindowNode(node1, WindowUpdateType::WINDOW_UPDATE_ACTIVE);
476     Rect actualRect = node1->GetRequestRect();
477     Rect expectRect = {0, 0, 0, 0};
478     ASSERT_EQ(expectRect, actualRect);
479 }
480 
481 /**
482  * @tc.name: PreProcessWindowNode03
483  * @tc.desc: PreProcessWindowNode with WINDOW_UPDATE_ADDED, and isShowingOnMultiDisplays_ is true
484  * @tc.type: FUNC
485  */
HWTEST_F(DisplayGroupControllerTest, PreProcessWindowNode03, Function | SmallTest | Level2)486 HWTEST_F(DisplayGroupControllerTest, PreProcessWindowNode03, Function | SmallTest | Level2)
487 {
488     sptr<WindowNode> node1 = new WindowNode();
489     node1->SetWindowProperty(CreateWindowProperty(100));
490     ASSERT_NE(nullptr, node1);
491     node1->isShowingOnMultiDisplays_ = true;
492     displayGroupController_->PreProcessWindowNode(node1, WindowUpdateType::WINDOW_UPDATE_ADDED);
493     Rect actualRect = node1->GetRequestRect();
494     Rect expectRect = {0, 0, 0, 0};
495     ASSERT_EQ(expectRect, actualRect);
496 }
497 
498 
499 /**
500  * @tc.name: PostProcessWindowNode01
501  * @tc.desc: PostProcessWindowNode with multi display is true
502  * @tc.type: FUNC
503  */
HWTEST_F(DisplayGroupControllerTest, PostProcessWindowNode01, Function | SmallTest | Level2)504 HWTEST_F(DisplayGroupControllerTest, PostProcessWindowNode01, Function | SmallTest | Level2)
505 {
506     sptr<WindowNode> node1 = new WindowNode();
507     node1->SetWindowProperty(CreateWindowProperty(100));
508     ASSERT_NE(nullptr, node1);
509     container_->GetLayoutPolicy()->isMultiDisplay_ = true;
510     ASSERT_EQ(true, container_->GetLayoutPolicy()->IsMultiDisplay());
511 }
512 
513 /**
514  * @tc.name: UpdateWindowDisplayId01
515  * @tc.desc: UpdateWindowDisplayId with windowToken
516  * @tc.type: FUNC
517  */
HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayId01, Function | SmallTest | Level2)518 HWTEST_F(DisplayGroupControllerTest, UpdateWindowDisplayId01, Function | SmallTest | Level2)
519 {
520     sptr<IRemoteObject> iRemoteObjectMocker = new IRemoteObjectMocker();
521     sptr<IWindow> iWindow = iface_cast<IWindow>(iRemoteObjectMocker);
522     ASSERT_NE(nullptr, iWindow);
523     sptr<WindowNode> node1 = new WindowNode();
524     node1->SetWindowProperty(CreateWindowProperty(100));
525     ASSERT_NE(nullptr, node1);
526     node1->SetWindowToken(iWindow);
527     ASSERT_NE(nullptr, node1->GetWindowToken());
528     displayGroupController_->UpdateWindowDisplayId(node1, 1);
529     ASSERT_EQ(1, node1->GetDisplayId());
530 }
531 
532 /**
533  * @tc.name: MoveCrossNodeToTargetDisplay01
534  * @tc.desc: TargetDisplayId equals to default displayId
535  * @tc.type: FUNC
536  */
HWTEST_F(DisplayGroupControllerTest, MoveCrossNodeToTargetDisplay01, Function | SmallTest | Level2)537 HWTEST_F(DisplayGroupControllerTest, MoveCrossNodeToTargetDisplay01, Function | SmallTest | Level2)
538 {
539     sptr<WindowNode> node1 = new WindowNode();
540     node1->SetWindowProperty(CreateWindowProperty(100));
541     ASSERT_NE(nullptr, node1);
542     sptr<WindowNode> child = new WindowNode();
543     child->SetWindowProperty(CreateWindowProperty(101));
544     ASSERT_NE(nullptr, child);
545     node1->children_.push_back(child);
546     displayGroupController_->MoveCrossNodeToTargetDisplay(node1, 0);
547     auto showingDisplays = child->GetShowingDisplays();
548     ASSERT_NE(0, showingDisplays.size());
549     ASSERT_EQ(0, showingDisplays[0]);
550 }
551 
552 /**
553  * @tc.name: ProcessNotCrossNodesOnDestroyedDisplay01
554  * @tc.desc: DisplayId equals to defaultDisplayId
555  * @tc.type: FUNC
556  */
HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay01, Function | SmallTest | Level2)557 HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay01, Function | SmallTest | Level2)
558 {
559     std::vector<uint32_t> windowIds;
560     displayGroupController_->ProcessNotCrossNodesOnDestroyedDisplay(0, windowIds);
561     ASSERT_EQ(0, windowIds.size());
562 }
563 
564 /**
565  * @tc.name: ProcessNotCrossNodesOnDestroyedDisplay04
566  * @tc.desc: Node with WINDOW_TYPE_STATUS_BAR
567  * @tc.type: FUNC
568  */
HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay04, Function | SmallTest | Level2)569 HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay04, Function | SmallTest | Level2)
570 {
571     displayGroupController_->InitNewDisplay(1);
572     SetDisplayGroupInfo(1, {200, 200, 200, 200});
573     sptr<WindowNode> node1 = new WindowNode();
574     node1->SetWindowProperty(CreateWindowProperty(100, WindowType::WINDOW_TYPE_STATUS_BAR));
575     ASSERT_NE(nullptr, node1);
576     displayGroupController_->InitNewDisplay(1);
577     SetDisplayGroupInfo(1, {200, 200, 200, 200});
578     std::vector<sptr<WindowNode>>* rootApp = displayGroupController_->GetWindowNodesByDisplayIdAndRootType(
579         1, WindowRootNodeType::ABOVE_WINDOW_NODE);
580     rootApp->push_back(node1);
581     node1->SetDisplayId(1);
582     std::vector<uint32_t> windowIds;
583     displayGroupController_->ProcessNotCrossNodesOnDestroyedDisplay(1, windowIds);
584     ASSERT_EQ(1, windowIds.size());
585     ASSERT_EQ(1, node1->GetDisplayId());
586 }
587 
588 /**
589  * @tc.name: ProcessNotCrossNodesOnDestroyedDisplay06
590  * @tc.desc: Execute to move to default display
591  * @tc.type: FUNC
592  */
HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay06, Function | SmallTest | Level2)593 HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay06, Function | SmallTest | Level2)
594 {
595     displayGroupController_->InitNewDisplay(1);
596     SetDisplayGroupInfo(1, {200, 200, 200, 200});
597     sptr<WindowNode> node1 = new WindowNode();
598     node1->SetWindowProperty(CreateWindowProperty(100));
599     ASSERT_NE(nullptr, node1);
600     displayGroupController_->InitNewDisplay(1);
601     SetDisplayGroupInfo(1, {200, 200, 200, 200});
602     std::vector<sptr<WindowNode>>* rootApp = displayGroupController_->GetWindowNodesByDisplayIdAndRootType(
603         1, WindowRootNodeType::APP_WINDOW_NODE);
604     rootApp->push_back(node1);
605     node1->SetDisplayId(1);
606     std::vector<uint32_t> windowIds;
607     windowIds.push_back(node1->GetWindowId());
608     displayGroupController_->ProcessNotCrossNodesOnDestroyedDisplay(1, windowIds);
609     ASSERT_EQ(0, node1->GetDisplayId());
610 }
611 
612 /**
613  * @tc.name: ProcessNotCrossNodesOnDestroyedDisplay07
614  * @tc.desc: DisplayId not equals to defaultDisplayId, and no node on groupWindowTree
615  * @tc.type: FUNC
616  */
HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay07, Function | SmallTest | Level2)617 HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay07, Function | SmallTest | Level2)
618 {
619     displayGroupController_->InitNewDisplay(1);
620     SetDisplayGroupInfo(1, {200, 200, 200, 200});
621     std::vector<uint32_t> windowIds;
622     displayGroupController_->ProcessNotCrossNodesOnDestroyedDisplay(1, windowIds);
623     ASSERT_EQ(0, windowIds.size());
624 }
625 
626 /**
627  * @tc.name: UpdateNodeSizeChangeReasonWithRotation02
628  * @tc.desc: UpdateNodeSizeChangeReasonWithRotation failed
629  * @tc.type: FUNC
630  */
HWTEST_F(DisplayGroupControllerTest, UpdateNodeSizeChangeReasonWithRotation02, Function | SmallTest | Level2)631 HWTEST_F(DisplayGroupControllerTest, UpdateNodeSizeChangeReasonWithRotation02, Function | SmallTest | Level2)
632 {
633     sptr<WindowNode> node1 = new WindowNode();
634     node1->SetWindowProperty(CreateWindowProperty(100, WindowType::WINDOW_TYPE_DOCK_SLICE));
635     ASSERT_NE(nullptr, node1);
636     std::vector<sptr<WindowNode>>* rootApp = displayGroupController_->GetWindowNodesByDisplayIdAndRootType(
637         0, WindowRootNodeType::ABOVE_WINDOW_NODE);
638     rootApp->push_back(node1);
639     displayGroupController_->UpdateNodeSizeChangeReasonWithRotation(0, displayGroupInfo_.GetAllDisplayRects());
640     ASSERT_NE(WindowSizeChangeReason::ROTATION, node1->GetWindowSizeChangeReason());
641 }
642 
643 /**
644  * @tc.name: UpdateNodeSizeChangeReasonWithRotation03
645  * @tc.desc: UpdateNodeSizeChangeReasonWithRotation with rootNodeVectorPtr null
646  * @tc.type: FUNC
647  */
HWTEST_F(DisplayGroupControllerTest, UpdateNodeSizeChangeReasonWithRotation03, Function | SmallTest | Level2)648 HWTEST_F(DisplayGroupControllerTest, UpdateNodeSizeChangeReasonWithRotation03, Function | SmallTest | Level2)
649 {
650     displayGroupController_->displayGroupWindowTree_[0].erase(WindowRootNodeType::ABOVE_WINDOW_NODE);
651     ASSERT_EQ(nullptr, displayGroupController_->GetWindowNodesByDisplayIdAndRootType(
652         0, WindowRootNodeType::ABOVE_WINDOW_NODE));
653     displayGroupController_->UpdateNodeSizeChangeReasonWithRotation(0, displayGroupInfo_.GetAllDisplayRects());
654     ASSERT_EQ(nullptr, displayGroupController_->GetWindowNodesByDisplayIdAndRootType(
655         0, WindowRootNodeType::ABOVE_WINDOW_NODE));
656 }
657 
658 /**
659  * @tc.name: ProcessDisplayChange01
660  * @tc.desc: ProcessDisplayChange with different DisplayStateChangeType
661  * @tc.type: FUNC
662  */
HWTEST_F(DisplayGroupControllerTest, ProcessDisplayChange01, Function | SmallTest | Level2)663 HWTEST_F(DisplayGroupControllerTest, ProcessDisplayChange01, Function | SmallTest | Level2)
664 {
665     sptr<DisplayInfo> displayInfo = new DisplayInfo();
666     ASSERT_NE(nullptr, displayInfo);
667     displayInfo->SetDisplayId(0);
668     displayGroupController_->ProcessDisplayChange(0, displayInfo, displayGroupInfo_.GetAllDisplayRects(),
669         DisplayStateChangeType::UPDATE_ROTATION);
670     displayGroupController_->ProcessDisplayChange(0, displayInfo, displayGroupInfo_.GetAllDisplayRects(),
671         DisplayStateChangeType::DISPLAY_COMPRESS);
672     displayGroupController_->ProcessDisplayChange(0, displayInfo, displayGroupInfo_.GetAllDisplayRects(),
673         DisplayStateChangeType::SIZE_CHANGE);
674     displayGroupController_->ProcessDisplayChange(0, displayInfo, displayGroupInfo_.GetAllDisplayRects(),
675         DisplayStateChangeType::VIRTUAL_PIXEL_RATIO_CHANGE);
676     displayGroupController_->ProcessDisplayChange(0, displayInfo, displayGroupInfo_.GetAllDisplayRects(),
677         DisplayStateChangeType::DESTROY);
678 }
679 
680 /**
681  * @tc.name: ProcessDisplaySizeChangeOrRotation01
682  * @tc.desc: ProcessDisplaySizeChangeOrRotation with layout policy null
683  * @tc.type: FUNC
684  */
HWTEST_F(DisplayGroupControllerTest, ProcessDisplaySizeChangeOrRotation01, Function | SmallTest | Level2)685 HWTEST_F(DisplayGroupControllerTest, ProcessDisplaySizeChangeOrRotation01, Function | SmallTest | Level2)
686 {
687     auto oriLayoutPolicy = container_->GetLayoutPolicy();
688     container_->layoutPolicy_ = nullptr;
689     displayGroupController_->ProcessDisplaySizeChangeOrRotation(0, 0, displayGroupInfo_.GetAllDisplayRects(),
690         DisplayStateChangeType::UPDATE_ROTATION);
691     ASSERT_EQ(nullptr, container_->GetLayoutPolicy());
692     container_->layoutPolicy_ = oriLayoutPolicy;
693 }
694 
695 /**
696  * @tc.name: GetWindowPairByDisplayId
697  * @tc.desc: GetWindowPairByDisplayId with displayId 1, which not exists
698  * @tc.type: FUNC
699  */
HWTEST_F(DisplayGroupControllerTest, GetWindowPairByDisplayId01, Function | SmallTest | Level2)700 HWTEST_F(DisplayGroupControllerTest, GetWindowPairByDisplayId01, Function | SmallTest | Level2)
701 {
702     ASSERT_EQ(nullptr, displayGroupController_->GetWindowPairByDisplayId(1));
703 }
704 
705 /**
706  * @tc.name: ProcessDisplayCreate
707  * @tc.desc: ProcessDisplayCreate
708  * @tc.type: FUNC
709  */
HWTEST_F(DisplayGroupControllerTest, ProcessDisplayCreate, Function | SmallTest | Level2)710 HWTEST_F(DisplayGroupControllerTest, ProcessDisplayCreate, Function | SmallTest | Level2)
711 {
712     DisplayId defaultDisplayId = 0;
713     sptr<DisplayInfo> displayInfo = new DisplayInfo();
714     std::map<DisplayId, Rect> displayRectMap;
715     displayGroupController_->ProcessDisplayCreate(defaultDisplayId, displayInfo, displayRectMap);
716     auto layoutPolicy = container_->GetLayoutPolicy();
717     ASSERT_NE(nullptr, layoutPolicy);
718 }
719 
720 /**
721  * @tc.name: ProcessDisplayDestroy
722  * @tc.desc: ProcessDisplayDestroy
723  * @tc.type: FUNC
724  */
HWTEST_F(DisplayGroupControllerTest, ProcessDisplayDestroy, Function | SmallTest | Level2)725 HWTEST_F(DisplayGroupControllerTest, ProcessDisplayDestroy, Function | SmallTest | Level2)
726 {
727     DisplayId defaultDisplayId = 0;
728     sptr<DisplayInfo> displayInfo = new DisplayInfo();
729     std::map<DisplayId, Rect> displayRectMap;
730     std::vector<uint32_t> windowIds;
731     displayGroupController_->ProcessDisplayDestroy(defaultDisplayId, displayInfo,
732                                                    displayRectMap, windowIds);
733     auto layoutPolicy = container_->GetLayoutPolicy();
734     ASSERT_NE(nullptr, layoutPolicy);
735 }
736 
737 /**
738  * @tc.name: ProcessSystemBarRotation
739  * @tc.desc: ProcessSystemBarRotation
740  * @tc.type: FUNC
741  */
HWTEST_F(DisplayGroupControllerTest, ProcessSystemBarRotation, Function | SmallTest | Level2)742 HWTEST_F(DisplayGroupControllerTest, ProcessSystemBarRotation, Function | SmallTest | Level2)
743 {
744     sptr<WindowNode> node = new WindowNode();
745     node->SetWindowProperty(CreateWindowProperty(100));
746     ASSERT_NE(nullptr, node);
747     std::map<DisplayId, Rect> displayRectMap = {};
748     displayGroupController_->ProcessSystemBarRotation(node, displayRectMap);
749     auto layoutPolicy = container_->GetLayoutPolicy();
750     ASSERT_NE(nullptr, layoutPolicy);
751 }
752 
753 /**
754  * @tc.name: ProcessWindowPairWhenDisplayChange
755  * @tc.desc: ProcessWindowPairWhenDisplayChange
756  * @tc.type: FUNC
757  */
HWTEST_F(DisplayGroupControllerTest, ProcessWindowPairWhenDisplayChange, Function | SmallTest | Level2)758 HWTEST_F(DisplayGroupControllerTest, ProcessWindowPairWhenDisplayChange, Function | SmallTest | Level2)
759 {
760     bool rotateDisplay = true;
761     displayGroupController_->ProcessWindowPairWhenDisplayChange(rotateDisplay);
762     auto layoutPolicy = container_->GetLayoutPolicy();
763     layoutPolicy = nullptr;
764     ASSERT_EQ(nullptr, layoutPolicy);
765 }
766 /**
767  * @tc.name: ProcessNotCrossNodesOnDestroyedDisplay08
768  * @tc.desc: DisplayId not equals to defaultDisplayId, and no node on groupWindowTree
769  * @tc.type: FUNC
770  */
HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay08, Function | SmallTest | Level2)771 HWTEST_F(DisplayGroupControllerTest, ProcessNotCrossNodesOnDestroyedDisplay08, Function | SmallTest | Level2)
772 {
773     DisplayId displayId = 0;
774     std::vector<uint32_t> windowIds;
775     DisplayGroupWindowTree displayGroupWindowTree_;
776     displayGroupWindowTree_.find(displayId) = displayGroupWindowTree_.end();
777     displayGroupController_->ProcessNotCrossNodesOnDestroyedDisplay(1, windowIds);
778     ASSERT_EQ(0, windowIds.size());
779 }
780 
781 /**
782  * @tc.name: SetSplitRatioConfig
783  * @tc.desc:SetSplitRatioConfig
784  * @tc.type: FUNC
785  */
HWTEST_F(DisplayGroupControllerTest, SetSplitRatioConfig, Function | SmallTest | Level2)786 HWTEST_F(DisplayGroupControllerTest, SetSplitRatioConfig, Function | SmallTest | Level2)
787 {
788     DisplayId displayId = 0;
789     std::vector<uint32_t> windowIds;
790     SplitRatioConfig splitRatioConfig;
791     displayGroupController_->SetSplitRatioConfig(splitRatioConfig);
792     auto windowPair = displayGroupController_->GetWindowPairByDisplayId(displayId);
793     windowPair = nullptr;
794     DisplayGroupWindowTree displayGroupWindowTree_;
795     displayGroupWindowTree_.find(displayId) = displayGroupWindowTree_.end();
796     displayGroupController_->ProcessNotCrossNodesOnDestroyedDisplay(1, windowIds);
797     ASSERT_EQ(0, windowIds.size());
798 }
799 
800 /**
801  * @tc.name: UpdateSplitRatioPoints01
802  * @tc.desc:UpdateSplitRatioPoints
803  * @tc.type: FUNC
804  */
HWTEST_F(DisplayGroupControllerTest, UpdateSplitRatioPoints01, Function | SmallTest | Level2)805 HWTEST_F(DisplayGroupControllerTest, UpdateSplitRatioPoints01, Function | SmallTest | Level2)
806 {
807     DisplayId displayId = 0;
808     std::vector<uint32_t> windowIds;
809     auto windowPair = displayGroupController_->GetWindowPairByDisplayId(displayId);
810     windowPair = nullptr;
811     displayGroupController_->UpdateSplitRatioPoints(displayId);
812     DisplayGroupWindowTree displayGroupWindowTree_;
813     displayGroupWindowTree_.find(displayId) = displayGroupWindowTree_.end();
814     displayGroupController_->ProcessNotCrossNodesOnDestroyedDisplay(1, windowIds);
815     ASSERT_EQ(0, windowIds.size());
816 }
817 
818 /**
819  * @tc.name: UpdateSplitRatioPoints02
820  * @tc.desc:UpdateSplitRatioPoints
821  * @tc.type: FUNC
822  */
HWTEST_F(DisplayGroupControllerTest, UpdateSplitRatioPoints02, Function | SmallTest | Level2)823 HWTEST_F(DisplayGroupControllerTest, UpdateSplitRatioPoints02, Function | SmallTest | Level2)
824 {
825     DisplayId displayId = 0;
826     std::vector<uint32_t> windowIds;
827     auto displayRects = DisplayGroupInfo::GetInstance().GetAllDisplayRects();
828     displayRects.find(displayId) = displayRects.end();
829     displayGroupController_->UpdateSplitRatioPoints(displayId);
830     DisplayGroupWindowTree displayGroupWindowTree_;
831     displayGroupWindowTree_.find(displayId) = displayGroupWindowTree_.end();
832     displayGroupController_->ProcessNotCrossNodesOnDestroyedDisplay(1, windowIds);
833     ASSERT_EQ(0, windowIds.size());
834 }
835 
836 /**
837  * @tc.name: UpdateSplitRatioPoints03
838  * @tc.desc:UpdateSplitRatioPoints
839  * @tc.type: FUNC
840  */
HWTEST_F(DisplayGroupControllerTest, UpdateSplitRatioPoints03, Function | SmallTest | Level2)841 HWTEST_F(DisplayGroupControllerTest, UpdateSplitRatioPoints03, Function | SmallTest | Level2)
842 {
843     DisplayId displayId = 0;
844     std::vector<uint32_t> windowIds;
845     auto layoutPolicy = container_->GetLayoutPolicy();
846     layoutPolicy = nullptr;
847     displayGroupController_->UpdateSplitRatioPoints(displayId);
848     DisplayGroupWindowTree displayGroupWindowTree_;
849     displayGroupWindowTree_.find(displayId) = displayGroupWindowTree_.end();
850     displayGroupController_->ProcessNotCrossNodesOnDestroyedDisplay(1, windowIds);
851     ASSERT_EQ(0, windowIds.size());
852 }
853 
854 /**
855  * @tc.name: PreProcessWindowNode05
856  * @tc.desc:UpdateSplitRatioPoints
857  * @tc.type: FUNC
858  */
HWTEST_F(DisplayGroupControllerTest, PreProcessWindowNode05, Function | SmallTest | Level2)859 HWTEST_F(DisplayGroupControllerTest, PreProcessWindowNode05, Function | SmallTest | Level2)
860 {
861     WindowUpdateType type = WindowUpdateType::WINDOW_UPDATE_ACTIVE;
862     sptr<WindowNode> node1 = new WindowNode();
863     node1->SetWindowProperty(CreateWindowProperty(100));
864     ASSERT_NE(nullptr, node1);
865     displayGroupController_->PreProcessWindowNode(node1, type);
866     if (type != WindowUpdateType::WINDOW_UPDATE_ADDED)
867     {
868         type = WindowUpdateType::WINDOW_UPDATE_ADDED;
869     }
870     std::vector<uint32_t> windowIds;
871     ASSERT_EQ(0, windowIds.size());
872 }
873 }
874 }
875 }
876