1 /*
2 * Copyright (c) 2021-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 #include "gtest/gtest.h"
16 #include "ui_driver.h"
17 #include "ui_model.h"
18 #include "mock_element_node_iterator.h"
19 #include "mock_controller.h"
20
21 using namespace OHOS::uitest;
22 using namespace std;
23
24 // test fixture
25
26 class UiDriverTest : public testing::Test {
27 protected:
SetUp()28 void SetUp() override
29 {
30 auto mockController = make_unique<MockController>();
31 controller_ = mockController.get();
32 UiDriver::RegisterController(move(mockController));
33 driver_ = make_unique<UiDriver>();
34 }
35
TearDown()36 void TearDown() override
37 {
38 controller_ = nullptr;
39 }
40
41 MockController *controller_ = nullptr;
42 unique_ptr<UiDriver> driver_ = nullptr;
43 UiOpArgs opt_;
44
45 ~UiDriverTest() override = default;
46 };
47
TEST_F(UiDriverTest,normalInteraction)48 TEST_F(UiDriverTest, normalInteraction)
49 {
50 std::string nodeJson = R"(
51 {
52 "attributes":{
53 "windowId":"12",
54 "bundleName":"test1",
55 "componentType":"List",
56 "accessibilityId":"1",
57 "content":"Text List",
58 "rectInScreen":"30,60,10,120"
59 },
60 "children":[
61 {
62 "attributes":{
63 "windowId":"12",
64 "bundleName":"test1",
65 "componentType":"Text",
66 "accessibilityId":"100",
67 "content":"USB",
68 "rectInScreen":"30,60,10,20"
69 },
70 "children":[]
71 }
72 ]
73 }
74 )";
75
76 std::vector<MockAccessibilityElementInfo> eles =
77 MockElementNodeIterator::ConstructIteratorByJson(nodeJson)->elementInfoLists_;
78
79 Window w1{12};
80 w1.windowLayer_ = 2;
81 w1.bounds_ = Rect{0, 100, 0, 120};
82
83 controller_->AddWindowsAndNode(w1, eles);
84
85 auto error = ApiCallErr(NO_ERROR);
86 auto selector = WidgetSelector();
87 auto matcher = WidgetMatchModel(UiAttr::TEXT, "USB", EQ);
88 selector.AddMatcher(matcher);
89 vector<unique_ptr<Widget>> widgets;
90 selector.SetWantMulti(false);
91 driver_->FindWidgets(selector, widgets, error, true);
92
93 ASSERT_EQ(1, widgets.size());
94 // perform interactions
95 auto key = Back();
96 driver_->TriggerKey(key, opt_, error);
97 ASSERT_EQ(NO_ERROR, error.code_);
98 }
99
TEST_F(UiDriverTest,retrieveWidget)100 TEST_F(UiDriverTest, retrieveWidget)
101 {
102 std::string nodeJson = R"(
103 {
104 "attributes":{
105 "windowId":"12",
106 "bundleName":"test1",
107 "componentType":"List",
108 "accessibilityId":"1",
109 "content":"Text List",
110 "rectInScreen":"30,60,10,120"
111 },
112 "children":[
113 {
114 "attributes":{
115 "windowId":"12",
116 "bundleName":"test1",
117 "componentType":"Text",
118 "accessibilityId":"100",
119 "content":"USB",
120 "rectInScreen":"30,60,10,20"
121 },
122 "children":[]
123 }
124 ]
125 }
126 )";
127
128 std::vector<MockAccessibilityElementInfo> eles =
129 MockElementNodeIterator::ConstructIteratorByJson(nodeJson)->elementInfoLists_;
130
131 Window w1{12};
132 w1.windowLayer_ = 2;
133 w1.bounds_ = Rect{0, 100, 0, 120};
134
135 controller_->AddWindowsAndNode(w1, eles);
136
137 auto error = ApiCallErr(NO_ERROR);
138 auto selector = WidgetSelector();
139 auto matcher = WidgetMatchModel(UiAttr::TEXT, "USB", EQ);
140 selector.AddMatcher(matcher);
141 vector<unique_ptr<Widget>> widgets;
142 selector.SetWantMulti(false);
143 driver_->FindWidgets(selector, widgets, error, true);
144
145 ASSERT_EQ(1, widgets.size());
146
147 // mock another dom on which the target widget is missing, and perform click
148
149 std::vector<MockAccessibilityElementInfo> eles_ =
150 MockElementNodeIterator::ConstructIteratorByJson(nodeJson)->elementInfoLists_;
151 controller_->AddWindowsAndNode(w1, eles_);
152 error = ApiCallErr(NO_ERROR);
153 auto ret = driver_->RetrieveWidget(*widgets.at(0), error, true);
154
155 // retrieve widget failed should be marked as exception
156 ASSERT_EQ(NO_ERROR, error.code_);
157 ASSERT_TRUE(ret->GetAttr(UiAttr::TEXT) == "USB");
158 }
159
TEST_F(UiDriverTest,retrieveWidgetFailure)160 TEST_F(UiDriverTest, retrieveWidgetFailure)
161 {
162 std::string beforeNodeJson = R"(
163 {
164 "attributes":{
165 "windowId":"12",
166 "bundleName":"test1",
167 "componentType":"List",
168 "accessibilityId":"1",
169 "content":"Text List",
170 "rectInScreen":"30,60,10,120"
171 },
172 "children":[
173 {
174 "attributes":{
175 "windowId":"12",
176 "bundleName":"test1",
177 "componentType":"Text",
178 "accessibilityId":"100",
179 "content":"USB",
180 "rectInScreen":"30,60,10,20"
181 },
182 "children":[]
183 }
184 ]
185 }
186 )";
187
188 std::vector<MockAccessibilityElementInfo> eles =
189 MockElementNodeIterator::ConstructIteratorByJson(beforeNodeJson)->elementInfoLists_;
190
191 Window w1{12};
192 w1.windowLayer_ = 2;
193 w1.bounds_ = Rect{0, 100, 0, 120};
194
195 controller_->AddWindowsAndNode(w1, eles);
196
197 auto error = ApiCallErr(NO_ERROR);
198 auto selector = WidgetSelector();
199 auto matcher = WidgetMatchModel(UiAttr::TEXT, "USB", EQ);
200 selector.AddMatcher(matcher);
201 vector<unique_ptr<Widget>> widgets;
202 selector.SetWantMulti(false);
203 driver_->FindWidgets(selector, widgets, error, true);
204
205 ASSERT_EQ(1, widgets.size());
206
207 // mock another dom on which the target widget is missing, and perform click
208 std::string afterNodeJson = R"(
209 {
210 "attributes":{
211 "windowId":"12",
212 "bundleName":"test1",
213 "componentType":"List",
214 "accessibilityId":"1",
215 "content":"Text List",
216 "rectInScreen":"30,60,10,120"
217 },
218 "children":[
219 {
220 "attributes":{
221 "windowId":"12",
222 "bundleName":"test1",
223 "componentType":"Text",
224 "accessibilityId":"101",
225 "content":"USB",
226 "rectInScreen":"30,60,10,20"
227 },
228 "children":[]
229 }
230 ]
231 }
232 )";
233
234 std::vector<MockAccessibilityElementInfo> eles_ =
235 MockElementNodeIterator::ConstructIteratorByJson(afterNodeJson)->elementInfoLists_;
236
237 controller_->RemoveWindowsAndNode(w1);
238 controller_->AddWindowsAndNode(w1, eles_);
239 error = ApiCallErr(NO_ERROR);
240 driver_->RetrieveWidget(*widgets.at(0), error, true);
241
242 // retrieve widget failed should be marked as exception
243 ASSERT_EQ(ERR_COMPONENT_LOST, error.code_);
244 ASSERT_TRUE(error.message_.find(selector.Describe()) != string::npos)
245 << "Error message should contains the widget selection description";
246 }
247
TEST_F(UiDriverTest,FindWindowByBundleName)248 TEST_F(UiDriverTest, FindWindowByBundleName)
249 {
250 std::string window1NodeJson = R"(
251 {
252 "attributes":{
253 "windowId":"12",
254 "bundleName":"test12",
255 "componentType":"List",
256 "accessibilityId":"1",
257 "content":"Text List",
258 "rectInScreen":"30,60,10,120"
259 },
260 "children":[]
261 }
262 )";
263
264 std::vector<MockAccessibilityElementInfo> eles =
265 MockElementNodeIterator::ConstructIteratorByJson(window1NodeJson)->elementInfoLists_;
266
267 Window w1{12};
268 w1.windowLayer_ = 2;
269 w1.bounds_ = Rect{0, 100, 0, 120};
270 w1.bundleName_ = "test12";
271 controller_->AddWindowsAndNode(w1, eles);
272 std::string window2NodeJson = R"(
273 {
274 "attributes":{
275 "windowId":"123",
276 "bundleName":"test123",
277 "componentType":"List",
278 "accessibilityId":"1",
279 "content":"Text List",
280 "rectInScreen":"30,60,10,120"
281 },
282 "children":[]
283 }
284 )";
285
286 std::vector<MockAccessibilityElementInfo> eles_2 =
287 MockElementNodeIterator::ConstructIteratorByJson(window2NodeJson)->elementInfoLists_;
288
289 Window w2{123};
290 w2.windowLayer_ = 4;
291 w2.bounds_ = Rect{0, 100, 0, 120};
292 w2.bundleName_ = "test123";
293 controller_->AddWindowsAndNode(w2, eles_2);
294
295 auto error = ApiCallErr(NO_ERROR);
296
297 json filterBundle;
298 filterBundle["bundleName"] = "test12";
299 auto windowMatcher = [&filterBundle](const Window &window) -> bool {
300 bool match = true;
301 match = match && window.bundleName_ == filterBundle["bundleName"].get<string>();
302 return match;
303 };
304 auto winPtr = driver_->FindWindow(windowMatcher, error);
305
306 ASSERT_TRUE(winPtr != nullptr);
307 ASSERT_EQ(winPtr->id_, 12);
308
309 json filterBundleNotFind;
310 filterBundleNotFind["bundleName"] = "test12456";
311 auto windowMatcher2 = [&filterBundleNotFind](const Window &window) -> bool {
312 bool match = true;
313 match = match && window.bundleName_ == filterBundleNotFind["bundleName"].get<string>();
314 return match;
315 };
316 auto winPtrNull = driver_->FindWindow(windowMatcher2, error);
317 ASSERT_TRUE(winPtrNull == nullptr);
318 }
319
TEST_F(UiDriverTest,FindWindowByActived)320 TEST_F(UiDriverTest, FindWindowByActived)
321 {
322 std::string window1NodeJson = R"(
323 {
324 "attributes":{
325 "windowId":"12",
326 "bundleName":"test12",
327 "componentType":"List",
328 "accessibilityId":"1",
329 "content":"Text List",
330 "rectInScreen":"30,60,10,120"
331 },
332 "children":[]
333 }
334 )";
335
336 std::vector<MockAccessibilityElementInfo> eles =
337 MockElementNodeIterator::ConstructIteratorByJson(window1NodeJson)->elementInfoLists_;
338
339 Window w1{12};
340 w1.windowLayer_ = 2;
341 w1.actived_ = false;
342 w1.bounds_ = Rect{0, 100, 0, 120};
343 w1.bundleName_ = "test12";
344 controller_->AddWindowsAndNode(w1, eles);
345 std::string window2NodeJson = R"(
346 {
347 "attributes":{
348 "windowId":"123",
349 "bundleName":"test123",
350 "componentType":"List",
351 "accessibilityId":"1",
352 "content":"Text List",
353 "rectInScreen":"30,60,10,120"
354 },
355 "children":[]
356 }
357 )";
358
359 std::vector<MockAccessibilityElementInfo> eles_2 =
360 MockElementNodeIterator::ConstructIteratorByJson(window2NodeJson)->elementInfoLists_;
361
362 Window w2{123};
363 w2.windowLayer_ = 4;
364 w2.actived_ = true;
365 w2.bounds_ = Rect{0, 100, 0, 120};
366 w2.bundleName_ = "test123";
367 controller_->AddWindowsAndNode(w2, eles_2);
368
369 auto error = ApiCallErr(NO_ERROR);
370
371 json filterActive;
372 filterActive["actived"] = true;
373
374 auto windowMatcher = [&filterActive](const Window &window) -> bool {
375 bool match = true;
376 match = match && window.actived_ == filterActive["actived"].get<bool>();
377
378 return match;
379 };
380 auto winPtr = driver_->FindWindow(windowMatcher, error);
381
382 ASSERT_TRUE(winPtr != nullptr);
383 ASSERT_EQ(winPtr->id_, 123);
384 }
385
TEST_F(UiDriverTest,DumpUI)386 TEST_F(UiDriverTest, DumpUI)
387 {
388 std::string window2NodeJson = R"(
389 {
390 "attributes":{
391 "windowId":"123",
392 "bundleName":"test123",
393 "componentType":"List",
394 "accessibilityId":"1",
395 "content":"List",
396 "rectInScreen":"0,200,100,200"
397 },
398 "children":[
399 {
400 "attributes":{
401 "windowId":"123",
402 "bundleName":"test123",
403 "componentType":"Text",
404 "accessibilityId":"2",
405 "content":"Text List",
406 "rectInScreen":"0,200,100,200"
407 },
408 "children":[]
409 }
410 ]
411 }
412 )";
413 std::vector<MockAccessibilityElementInfo> eles_2 =
414 MockElementNodeIterator::ConstructIteratorByJson(window2NodeJson)->elementInfoLists_;
415 Window w2{123};
416 w2.windowLayer_ = 4;
417 w2.actived_ = true;
418 w2.bounds_ = Rect{0, 200, 100, 200};
419 w2.bundleName_ = "test123";
420 controller_->AddWindowsAndNode(w2, eles_2);
421 std::string window1NodeJson = R"(
422 {
423 "attributes":{
424 "windowId":"12",
425 "bundleName":"test12",
426 "componentType":"List",
427 "accessibilityId":"4",
428 "content":"Text List",
429 "rectInScreen":"30,60,10,120"
430 },
431 "children":[
432 {
433 "attributes":{
434 "windowId":"12",
435 "bundleName":"test12",
436 "componentType":"Text",
437 "accessibilityId":"6",
438 "content":"Text Test",
439 "rectInScreen":"30,60,10,120"
440 },
441 "children":[]
442 }
443 ]
444 }
445 )";
446 std::vector<MockAccessibilityElementInfo> eles =
447 MockElementNodeIterator::ConstructIteratorByJson(window1NodeJson)->elementInfoLists_;
448 Window w1{12};
449 w1.windowLayer_ = 2;
450 w1.invisibleBoundsVec_.emplace_back(w2.bounds_);
451 w1.actived_ = false;
452 w1.bounds_ = Rect{0, 100, 0, 120};
453 w1.bundleName_ = "test12";
454 controller_->AddWindowsAndNode(w1, eles);
455 auto error = ApiCallErr(NO_ERROR);
456 nlohmann::json out;
457 driver_->DumpUiHierarchy(out, false, false, error);
458 ASSERT_EQ(out["children"].size(), 2);
459 auto window1Json = out["children"][0];
460 ASSERT_EQ(window1Json["attributes"]["accessibilityId"], "1");
461 ASSERT_EQ(window1Json["attributes"]["text"], "List");
462 ASSERT_EQ(window1Json["attributes"]["bundleName"], "test123");
463 ASSERT_EQ(window1Json["children"].size(), 1);
464 ASSERT_EQ(window1Json["children"][0]["attributes"]["accessibilityId"], "2");
465 auto window2Json = out["children"][1];
466 ASSERT_EQ(window2Json["attributes"]["accessibilityId"], "4");
467 ASSERT_EQ(window2Json["attributes"]["type"], "List");
468 ASSERT_EQ(window2Json["attributes"]["bundleName"], "test12");
469 ASSERT_EQ(window2Json["attributes"]["text"], "Text List");
470 ASSERT_EQ(window2Json["attributes"]["origBounds"], "[30,10][60,120]");
471 ASSERT_EQ(window2Json["attributes"]["bounds"], "[30,10][60,100]");
472 ASSERT_EQ(window2Json["children"].size(), 1);
473 ASSERT_EQ(window2Json["children"][0]["attributes"]["accessibilityId"], "6");
474 ASSERT_EQ(window2Json["children"][0]["attributes"]["text"], "Text Test");
475 ASSERT_EQ(window2Json["children"][0]["attributes"]["origBounds"], "[30,10][60,120]");
476 ASSERT_EQ(window2Json["children"][0]["attributes"]["bounds"], "[30,10][60,100]");
477 }
478
TEST_F(UiDriverTest,DumpUI_I)479 TEST_F(UiDriverTest, DumpUI_I)
480 {
481 std::string window2NodeJson = R"(
482 {
483 "attributes":{
484 "windowId":"123",
485 "bundleName":"test123",
486 "componentType":"List",
487 "accessibilityId":"1",
488 "content":"List",
489 "rectInScreen":"0,200,100,200"
490 },
491 "children":[
492 {
493 "attributes":{
494 "windowId":"123",
495 "bundleName":"test123",
496 "componentType":"Text",
497 "accessibilityId":"2",
498 "content":"Text List",
499 "rectInScreen":"0,200,100,200"
500 },
501 "children":[]
502 }
503 ]
504 }
505 )";
506 std::vector<MockAccessibilityElementInfo> eles_2 =
507 MockElementNodeIterator::ConstructIteratorByJson(window2NodeJson)->elementInfoLists_;
508 Window w2{123};
509 w2.windowLayer_ = 4;
510 w2.actived_ = true;
511 w2.bounds_ = Rect{0, 200, 100, 200};
512 w2.bundleName_ = "test123";
513 controller_->AddWindowsAndNode(w2, eles_2);
514 std::string window1NodeJson = R"(
515 {
516 "attributes":{
517 "windowId":"12",
518 "bundleName":"test12",
519 "componentType":"List",
520 "accessibilityId":"4",
521 "content":"Text List",
522 "rectInScreen":"30,60,10,120"
523 },
524 "children":[
525 {
526 "attributes":{
527 "windowId":"12",
528 "bundleName":"test12",
529 "componentType":"Text",
530 "accessibilityId":"6",
531 "content":"Text Test",
532 "rectInScreen":"30,60,10,120"
533 },
534 "children":[]
535 }
536 ]
537 }
538 )";
539 std::vector<MockAccessibilityElementInfo> eles =
540 MockElementNodeIterator::ConstructIteratorByJson(window1NodeJson)->elementInfoLists_;
541 Window w1{12};
542 w1.windowLayer_ = 2;
543 w1.invisibleBoundsVec_.emplace_back(w2.bounds_);
544 w1.actived_ = false;
545 w1.bounds_ = Rect{0, 100, 0, 120};
546 w1.bundleName_ = "test12";
547 controller_->AddWindowsAndNode(w1, eles);
548 auto error = ApiCallErr(NO_ERROR);
549 nlohmann::json out;
550 driver_->DumpUiHierarchy(out, true, false, error);
551 ASSERT_EQ(out.size(), 2);
552 auto window1Json = out[0];
553 ASSERT_EQ(window1Json["attributes"]["accessibilityId"], "1");
554 ASSERT_EQ(window1Json["attributes"]["text"], "List");
555 ASSERT_EQ(window1Json["attributes"]["bundleName"], "test123");
556 ASSERT_EQ(window1Json["children"].size(), 1);
557 ASSERT_EQ(window1Json["children"][0]["attributes"]["accessibilityId"], "2");
558 auto window2Json = out[1];
559 ASSERT_EQ(window2Json["attributes"]["accessibilityId"], "4");
560 ASSERT_EQ(window2Json["attributes"]["type"], "List");
561 ASSERT_EQ(window2Json["attributes"]["bundleName"], "test12");
562 ASSERT_EQ(window2Json["attributes"]["text"], "Text List");
563 ASSERT_EQ(window2Json["attributes"]["origBounds"], "[30,10][60,120]");
564 ASSERT_EQ(window2Json["attributes"]["bounds"], "[30,10][60,120]");
565 ASSERT_EQ(window2Json["children"].size(), 1);
566 ASSERT_EQ(window2Json["children"][0]["attributes"]["accessibilityId"], "6");
567 ASSERT_EQ(window2Json["children"][0]["attributes"]["text"], "Text Test");
568 ASSERT_EQ(window2Json["children"][0]["attributes"]["origBounds"], "[30,10][60,120]");
569 ASSERT_EQ(window2Json["children"][0]["attributes"]["bounds"], "[30,10][60,120]");
570 }
571
572 class WindowCacheCompareGreater {
573 public:
operator ()(const WindowCacheModel & w1,const WindowCacheModel & w2)574 bool operator()(const WindowCacheModel &w1, const WindowCacheModel &w2)
575 {
576 if (w1.window_.actived_) {
577 return true;
578 }
579 if (w2.window_.actived_) {
580 return false;
581 }
582 if (w1.window_.focused_) {
583 return true;
584 }
585 if (w2.window_.focused_) {
586 return false;
587 }
588 return w1.window_.windowLayer_ > w2.window_.windowLayer_;
589 }
590 };
591
TEST_F(UiDriverTest,SORT_WINDOW)592 TEST_F(UiDriverTest, SORT_WINDOW)
593 {
594 Window w1{1};
595 w1.actived_ = false;
596 w1.focused_ = false;
597 w1.windowLayer_ = 1;
598 Window w2{2};
599 w2.actived_ = false;
600 w2.focused_ = false;
601 w2.windowLayer_ = 2;
602 Window w3{3};
603 w3.actived_ = true;
604 w3.focused_ = true;
605 w3.windowLayer_ = 3;
606 Window w4{4};
607 w4.actived_ = false;
608 w4.focused_ = false;
609 w4.windowLayer_ = 4;
610 Window w5{5};
611 w5.actived_ = false;
612 w5.focused_ = false;
613 w5.windowLayer_ = 5;
614 WindowCacheModel winModel1(w1);
615 WindowCacheModel winModel2(w2);
616 WindowCacheModel winModel3(w3);
617 WindowCacheModel winModel4(w4);
618 WindowCacheModel winModel5(w5);
619 vector<WindowCacheModel> modelVec;
620 modelVec.emplace_back(move(winModel5));
621 modelVec.emplace_back(move(winModel4));
622 modelVec.emplace_back(move(winModel3));
623 modelVec.emplace_back(move(winModel2));
624 modelVec.emplace_back(move(winModel1));
625 std::sort(modelVec.begin(), modelVec.end(), WindowCacheCompareGreater());
626 ASSERT_EQ(modelVec.at(0).window_.id_, 3);
627 ASSERT_EQ(modelVec.at(1).window_.id_, 5);
628 ASSERT_EQ(modelVec.at(2).window_.id_, 4);
629 ASSERT_EQ(modelVec.at(3).window_.id_, 2);
630 ASSERT_EQ(modelVec.at(4).window_.id_, 1);
631 }
632
TEST_F(UiDriverTest,SORT_WINDOW_ACTIVE)633 TEST_F(UiDriverTest, SORT_WINDOW_ACTIVE)
634 {
635 Window w1{1};
636 w1.actived_ = false;
637 w1.focused_ = false;
638 w1.windowLayer_ = 1;
639 Window w2{2};
640 w2.actived_ = true;
641 w2.focused_ = false;
642 w2.windowLayer_ = 2;
643 Window w3{3};
644 w3.actived_ = false;
645 w3.focused_ = true;
646 w3.windowLayer_ = 3;
647 Window w4{4};
648 w4.actived_ = false;
649 w4.focused_ = false;
650 w4.windowLayer_ = 4;
651 Window w5{5};
652 w5.actived_ = false;
653 w5.focused_ = false;
654 w5.windowLayer_ = 5;
655 WindowCacheModel winModel1{w1};
656 WindowCacheModel winModel2{w2};
657 WindowCacheModel winModel3{w3};
658 WindowCacheModel winModel4{w4};
659 WindowCacheModel winModel5{w5};
660 vector<WindowCacheModel> modelVec;
661 modelVec.emplace_back(move(winModel5));
662 modelVec.emplace_back(move(winModel4));
663 modelVec.emplace_back(move(winModel3));
664 modelVec.emplace_back(move(winModel2));
665 modelVec.emplace_back(move(winModel1));
666 std::sort(modelVec.begin(), modelVec.end(), WindowCacheCompareGreater());
667 ASSERT_EQ(modelVec.at(0).window_.id_, 2);
668 ASSERT_EQ(modelVec.at(1).window_.id_, 3);
669 ASSERT_EQ(modelVec.at(2).window_.id_, 5);
670 ASSERT_EQ(modelVec.at(3).window_.id_, 4);
671 ASSERT_EQ(modelVec.at(4).window_.id_, 1);
672 }