Merge lp:~gerboland/miral/fix-windowmanager-tests into lp:miral
- fix-windowmanager-tests
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 321 |
Proposed branch: | lp:~gerboland/miral/fix-windowmanager-tests |
Merge into: | lp:miral |
Diff against target: |
301 lines (+67/-10) 1 file modified
miral-qt/tests/modules/WindowManager/windowmodel_test.cpp (+67/-10) |
To merge this branch: | bzr merge lp:~gerboland/miral/fix-windowmanager-tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alan Griffiths | Approve | ||
Review via email:
|
Commit message
[miral-qt] Fix failing tests due to lack of event loop, and fix mocking the Window size so can enable its test
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gerry Boland (gerboland) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Griffiths (alan-griffiths) wrote : | # |
+// windowSpec.
useless
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Griffiths (alan-griffiths) wrote : | # |
> I could add functions to wrap each notifier.* method with flush() call, but
> wasn't sure the test readability would be enhanced. Second opinion desired.
Well, I'd be tempted by a bit more a restructuring of the tests:
All the tests start with:
WindowModel
WindowModel model(¬ifier, nullptr); // no need for controller in this testcase
I don't see why these can't be moved into the fixture.
Then the fixture can have:
void processEvents(
{
}
and the tests can have:
processEven
{
});
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alan Griffiths (alan-griffiths) wrote : | # |
If you want to land this and (optionally) rework the tests later then I'm fine with that.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Gerry Boland (gerboland) wrote : | # |
Rework more significant, so I'd prefer doing it separately
Preview Diff
1 | === modified file 'miral-qt/tests/modules/WindowManager/windowmodel_test.cpp' | |||
2 | --- miral-qt/tests/modules/WindowManager/windowmodel_test.cpp 2016-09-07 14:11:13 +0000 | |||
3 | +++ miral-qt/tests/modules/WindowManager/windowmodel_test.cpp 2016-09-08 23:24:56 +0000 | |||
4 | @@ -34,10 +34,19 @@ | |||
5 | 34 | 34 | ||
6 | 35 | namespace ms = mir::scene; | 35 | namespace ms = mir::scene; |
7 | 36 | namespace mg = mir::graphics; | 36 | namespace mg = mir::graphics; |
8 | 37 | using StubSurface = mir::test::doubles::StubSurface; | ||
9 | 38 | using StubSession = mir::test::doubles::StubSession; | 37 | using StubSession = mir::test::doubles::StubSession; |
10 | 39 | using namespace testing; | 38 | using namespace testing; |
11 | 40 | 39 | ||
12 | 40 | struct SizedStubSurface : public mir::test::doubles::StubSurface | ||
13 | 41 | { | ||
14 | 42 | mir::geometry::Size size() const override { return toMirSize(m_size); } | ||
15 | 43 | |||
16 | 44 | void setSize(QSize size) { m_size = size; } | ||
17 | 45 | |||
18 | 46 | private: | ||
19 | 47 | QSize m_size; | ||
20 | 48 | }; | ||
21 | 49 | |||
22 | 41 | 50 | ||
23 | 42 | class WindowModelTest : public ::testing::Test | 51 | class WindowModelTest : public ::testing::Test |
24 | 43 | { | 52 | { |
25 | @@ -51,16 +60,18 @@ | |||
26 | 51 | miral::WindowInfo createMirALWindowInfo(QPoint position = {160, 320}, QSize size = {100, 200}) | 60 | miral::WindowInfo createMirALWindowInfo(QPoint position = {160, 320}, QSize size = {100, 200}) |
27 | 52 | { | 61 | { |
28 | 53 | const miral::Application app{stubSession}; | 62 | const miral::Application app{stubSession}; |
29 | 63 | stubSurface->setSize(size); | ||
30 | 54 | const miral::Window window{app, stubSurface}; | 64 | const miral::Window window{app, stubSurface}; |
31 | 55 | 65 | ||
32 | 56 | ms::SurfaceCreationParameters windowSpec; | 66 | ms::SurfaceCreationParameters windowSpec; |
34 | 57 | windowSpec.of_size(toMirSize(size)); | 67 | // windowSpec.of_size(toMirSize(size)); // useless, Window/Surface has the size actually used |
35 | 58 | windowSpec.of_position(toMirPoint(position)); | 68 | windowSpec.of_position(toMirPoint(position)); |
36 | 59 | return miral::WindowInfo{window, windowSpec}; | 69 | return miral::WindowInfo{window, windowSpec}; |
37 | 60 | } | 70 | } |
38 | 61 | 71 | ||
39 | 62 | MirSurface *getMirSurfaceFromModel(const WindowModel &model, int index) | 72 | MirSurface *getMirSurfaceFromModel(const WindowModel &model, int index) |
40 | 63 | { | 73 | { |
41 | 74 | flushEvents(); | ||
42 | 64 | return model.data(model.index(index, 0), WindowModel::SurfaceRole).value<MirSurface*>(); | 75 | return model.data(model.index(index, 0), WindowModel::SurfaceRole).value<MirSurface*>(); |
43 | 65 | } | 76 | } |
44 | 66 | 77 | ||
45 | @@ -69,8 +80,26 @@ | |||
46 | 69 | return getMirSurfaceFromModel(model, index)->window(); | 80 | return getMirSurfaceFromModel(model, index)->window(); |
47 | 70 | } | 81 | } |
48 | 71 | 82 | ||
49 | 83 | void SetUp() override | ||
50 | 84 | { | ||
51 | 85 | int argc = 0; | ||
52 | 86 | char* argv[0]; | ||
53 | 87 | qtApp = new QCoreApplication(argc, argv); // needed for event loop | ||
54 | 88 | } | ||
55 | 89 | |||
56 | 90 | void TearDown() override | ||
57 | 91 | { | ||
58 | 92 | delete qtApp; | ||
59 | 93 | } | ||
60 | 94 | |||
61 | 95 | void flushEvents() | ||
62 | 96 | { | ||
63 | 97 | qtApp->sendPostedEvents(); | ||
64 | 98 | } | ||
65 | 99 | |||
66 | 72 | const std::shared_ptr<StubSession> stubSession{std::make_shared<StubSession>()}; | 100 | const std::shared_ptr<StubSession> stubSession{std::make_shared<StubSession>()}; |
68 | 73 | const std::shared_ptr<StubSurface> stubSurface{std::make_shared<StubSurface>()}; | 101 | const std::shared_ptr<SizedStubSurface> stubSurface{std::make_shared<SizedStubSurface>()}; |
69 | 102 | QCoreApplication *qtApp; | ||
70 | 74 | }; | 103 | }; |
71 | 75 | 104 | ||
72 | 76 | /* | 105 | /* |
73 | @@ -85,6 +114,7 @@ | |||
74 | 85 | auto mirWindowInfo = createMirALWindowInfo(); | 114 | auto mirWindowInfo = createMirALWindowInfo(); |
75 | 86 | 115 | ||
76 | 87 | notifier.addWindow(mirWindowInfo); | 116 | notifier.addWindow(mirWindowInfo); |
77 | 117 | flushEvents(); | ||
78 | 88 | 118 | ||
79 | 89 | EXPECT_EQ(1, model.count()); | 119 | EXPECT_EQ(1, model.count()); |
80 | 90 | } | 120 | } |
81 | @@ -103,6 +133,7 @@ | |||
82 | 103 | QSignalSpy spyCountChanged(&model, SIGNAL(countChanged())); | 133 | QSignalSpy spyCountChanged(&model, SIGNAL(countChanged())); |
83 | 104 | 134 | ||
84 | 105 | notifier.addWindow(mirWindowInfo); | 135 | notifier.addWindow(mirWindowInfo); |
85 | 136 | flushEvents(); | ||
86 | 106 | 137 | ||
87 | 107 | EXPECT_EQ(1, spyCountChanged.count()); | 138 | EXPECT_EQ(1, spyCountChanged.count()); |
88 | 108 | } | 139 | } |
89 | @@ -119,6 +150,7 @@ | |||
90 | 119 | auto mirWindowInfo = createMirALWindowInfo(); | 150 | auto mirWindowInfo = createMirALWindowInfo(); |
91 | 120 | 151 | ||
92 | 121 | notifier.addWindow(mirWindowInfo); | 152 | notifier.addWindow(mirWindowInfo); |
93 | 153 | flushEvents(); | ||
94 | 122 | 154 | ||
95 | 123 | auto miralWindow = getMirALWindowFromModel(model, 0); | 155 | auto miralWindow = getMirALWindowFromModel(model, 0); |
96 | 124 | EXPECT_EQ(mirWindowInfo.window(), miralWindow); | 156 | EXPECT_EQ(mirWindowInfo.window(), miralWindow); |
97 | @@ -138,6 +170,7 @@ | |||
98 | 138 | 170 | ||
99 | 139 | // Test removing the window | 171 | // Test removing the window |
100 | 140 | notifier.removeWindow(mirWindowInfo); | 172 | notifier.removeWindow(mirWindowInfo); |
101 | 173 | flushEvents(); | ||
102 | 141 | 174 | ||
103 | 142 | EXPECT_EQ(0, model.count()); | 175 | EXPECT_EQ(0, model.count()); |
104 | 143 | } | 176 | } |
105 | @@ -153,11 +186,13 @@ | |||
106 | 153 | 186 | ||
107 | 154 | auto mirWindowInfo = createMirALWindowInfo(); | 187 | auto mirWindowInfo = createMirALWindowInfo(); |
108 | 155 | notifier.addWindow(mirWindowInfo); | 188 | notifier.addWindow(mirWindowInfo); |
109 | 189 | flushEvents(); | ||
110 | 156 | 190 | ||
111 | 157 | // Test removing the window | 191 | // Test removing the window |
112 | 158 | QSignalSpy spyCountChanged(&model, SIGNAL(countChanged())); | 192 | QSignalSpy spyCountChanged(&model, SIGNAL(countChanged())); |
113 | 159 | 193 | ||
114 | 160 | notifier.removeWindow(mirWindowInfo); | 194 | notifier.removeWindow(mirWindowInfo); |
115 | 195 | flushEvents(); | ||
116 | 161 | 196 | ||
117 | 162 | EXPECT_EQ(1, spyCountChanged.count()); | 197 | EXPECT_EQ(1, spyCountChanged.count()); |
118 | 163 | } | 198 | } |
119 | @@ -176,6 +211,7 @@ | |||
120 | 176 | 211 | ||
121 | 177 | notifier.addWindow(mirWindowInfo1); | 212 | notifier.addWindow(mirWindowInfo1); |
122 | 178 | notifier.addWindow(mirWindowInfo2); | 213 | notifier.addWindow(mirWindowInfo2); |
123 | 214 | flushEvents(); | ||
124 | 179 | 215 | ||
125 | 180 | ASSERT_EQ(2, model.count()); | 216 | ASSERT_EQ(2, model.count()); |
126 | 181 | auto miralWindow1 = getMirALWindowFromModel(model, 0); | 217 | auto miralWindow1 = getMirALWindowFromModel(model, 0); |
127 | @@ -200,6 +236,7 @@ | |||
128 | 200 | 236 | ||
129 | 201 | // Remove second window | 237 | // Remove second window |
130 | 202 | notifier.removeWindow(mirWindowInfo2); | 238 | notifier.removeWindow(mirWindowInfo2); |
131 | 239 | flushEvents(); | ||
132 | 203 | 240 | ||
133 | 204 | ASSERT_EQ(1, model.count()); | 241 | ASSERT_EQ(1, model.count()); |
134 | 205 | auto miralWindow = getMirALWindowFromModel(model, 0); | 242 | auto miralWindow = getMirALWindowFromModel(model, 0); |
135 | @@ -222,6 +259,7 @@ | |||
136 | 222 | 259 | ||
137 | 223 | // Remove first window | 260 | // Remove first window |
138 | 224 | notifier.removeWindow(mirWindowInfo1); | 261 | notifier.removeWindow(mirWindowInfo1); |
139 | 262 | flushEvents(); | ||
140 | 225 | 263 | ||
141 | 226 | ASSERT_EQ(1, model.count()); | 264 | ASSERT_EQ(1, model.count()); |
142 | 227 | auto miralWindow = getMirALWindowFromModel(model, 0); | 265 | auto miralWindow = getMirALWindowFromModel(model, 0); |
143 | @@ -245,6 +283,7 @@ | |||
144 | 245 | notifier.removeWindow(mirWindowInfo1); | 283 | notifier.removeWindow(mirWindowInfo1); |
145 | 246 | 284 | ||
146 | 247 | notifier.addWindow(mirWindowInfo3); | 285 | notifier.addWindow(mirWindowInfo3); |
147 | 286 | flushEvents(); | ||
148 | 248 | 287 | ||
149 | 249 | ASSERT_EQ(2, model.count()); | 288 | ASSERT_EQ(2, model.count()); |
150 | 250 | auto miralWindow2 = getMirALWindowFromModel(model, 0); | 289 | auto miralWindow2 = getMirALWindowFromModel(model, 0); |
151 | @@ -270,6 +309,7 @@ | |||
152 | 270 | notifier.addWindow(mirWindowInfo3); | 309 | notifier.addWindow(mirWindowInfo3); |
153 | 271 | 310 | ||
154 | 272 | notifier.removeWindow(mirWindowInfo2); | 311 | notifier.removeWindow(mirWindowInfo2); |
155 | 312 | flushEvents(); | ||
156 | 273 | 313 | ||
157 | 274 | ASSERT_EQ(2, model.count()); | 314 | ASSERT_EQ(2, model.count()); |
158 | 275 | auto miralWindow1 = getMirALWindowFromModel(model, 0); | 315 | auto miralWindow1 = getMirALWindowFromModel(model, 0); |
159 | @@ -291,6 +331,7 @@ | |||
160 | 291 | 331 | ||
161 | 292 | // Raise first window | 332 | // Raise first window |
162 | 293 | notifier.raiseWindows({mirWindowInfo1.window()}); | 333 | notifier.raiseWindows({mirWindowInfo1.window()}); |
163 | 334 | flushEvents(); | ||
164 | 294 | 335 | ||
165 | 295 | ASSERT_EQ(1, model.count()); | 336 | ASSERT_EQ(1, model.count()); |
166 | 296 | auto topWindow = getMirALWindowFromModel(model, 0); | 337 | auto topWindow = getMirALWindowFromModel(model, 0); |
167 | @@ -312,6 +353,7 @@ | |||
168 | 312 | 353 | ||
169 | 313 | // Raise second window (currently on top) | 354 | // Raise second window (currently on top) |
170 | 314 | notifier.raiseWindows({mirWindowInfo2.window()}); | 355 | notifier.raiseWindows({mirWindowInfo2.window()}); |
171 | 356 | flushEvents(); | ||
172 | 315 | 357 | ||
173 | 316 | // Check second window still on top | 358 | // Check second window still on top |
174 | 317 | ASSERT_EQ(2, model.count()); | 359 | ASSERT_EQ(2, model.count()); |
175 | @@ -334,6 +376,7 @@ | |||
176 | 334 | 376 | ||
177 | 335 | // Raise first window (currently at bottom) | 377 | // Raise first window (currently at bottom) |
178 | 336 | notifier.raiseWindows({mirWindowInfo1.window()}); | 378 | notifier.raiseWindows({mirWindowInfo1.window()}); |
179 | 379 | flushEvents(); | ||
180 | 337 | 380 | ||
181 | 338 | // Check first window now on top | 381 | // Check first window now on top |
182 | 339 | ASSERT_EQ(2, model.count()); | 382 | ASSERT_EQ(2, model.count()); |
183 | @@ -368,6 +411,8 @@ | |||
184 | 368 | // 2: Window1 | 411 | // 2: Window1 |
185 | 369 | // 1: Window2 | 412 | // 1: Window2 |
186 | 370 | // 0: Window3 | 413 | // 0: Window3 |
187 | 414 | flushEvents(); | ||
188 | 415 | |||
189 | 371 | ASSERT_EQ(3, model.count()); | 416 | ASSERT_EQ(3, model.count()); |
190 | 372 | auto topWindow = getMirALWindowFromModel(model, 2); | 417 | auto topWindow = getMirALWindowFromModel(model, 2); |
191 | 373 | EXPECT_EQ(mirWindowInfo1.window(), topWindow); | 418 | EXPECT_EQ(mirWindowInfo1.window(), topWindow); |
192 | @@ -400,6 +445,8 @@ | |||
193 | 400 | // Model should now be like this: | 445 | // Model should now be like this: |
194 | 401 | // 1: Window1 | 446 | // 1: Window1 |
195 | 402 | // 0: Window2 | 447 | // 0: Window2 |
196 | 448 | flushEvents(); | ||
197 | 449 | |||
198 | 403 | ASSERT_EQ(2, model.count()); | 450 | ASSERT_EQ(2, model.count()); |
199 | 404 | auto topWindow = getMirALWindowFromModel(model, 1); | 451 | auto topWindow = getMirALWindowFromModel(model, 1); |
200 | 405 | EXPECT_EQ(mirWindowInfo1.window(), topWindow); | 452 | EXPECT_EQ(mirWindowInfo1.window(), topWindow); |
201 | @@ -435,6 +482,8 @@ | |||
202 | 435 | // 2: Window2 | 482 | // 2: Window2 |
203 | 436 | // 1: Window1 | 483 | // 1: Window1 |
204 | 437 | // 0: Window3 | 484 | // 0: Window3 |
205 | 485 | flushEvents(); | ||
206 | 486 | |||
207 | 438 | ASSERT_EQ(3, model.count()); | 487 | ASSERT_EQ(3, model.count()); |
208 | 439 | auto topWindow = getMirALWindowFromModel(model, 2); | 488 | auto topWindow = getMirALWindowFromModel(model, 2); |
209 | 440 | EXPECT_EQ(mirWindowInfo2.window(), topWindow); | 489 | EXPECT_EQ(mirWindowInfo2.window(), topWindow); |
210 | @@ -456,6 +505,7 @@ | |||
211 | 456 | 505 | ||
212 | 457 | auto mirWindowInfo = createMirALWindowInfo(position); | 506 | auto mirWindowInfo = createMirALWindowInfo(position); |
213 | 458 | notifier.addWindow(mirWindowInfo); | 507 | notifier.addWindow(mirWindowInfo); |
214 | 508 | flushEvents(); | ||
215 | 459 | 509 | ||
216 | 460 | auto surface = getMirSurfaceFromModel(model, 0); | 510 | auto surface = getMirSurfaceFromModel(model, 0); |
217 | 461 | EXPECT_EQ(position, surface->position()); | 511 | EXPECT_EQ(position, surface->position()); |
218 | @@ -479,6 +529,7 @@ | |||
219 | 479 | 529 | ||
220 | 480 | // Move window, check new position set | 530 | // Move window, check new position set |
221 | 481 | notifier.moveWindow(mirWindowInfo, toMirPoint(newPosition)); | 531 | notifier.moveWindow(mirWindowInfo, toMirPoint(newPosition)); |
222 | 532 | flushEvents(); | ||
223 | 482 | 533 | ||
224 | 483 | EXPECT_EQ(newPosition, surface->position()); | 534 | EXPECT_EQ(newPosition, surface->position()); |
225 | 484 | } | 535 | } |
226 | @@ -503,6 +554,7 @@ | |||
227 | 503 | 554 | ||
228 | 504 | // Move window, check new position set | 555 | // Move window, check new position set |
229 | 505 | notifier.moveWindow(mirWindowInfo1, toMirPoint(newPosition)); | 556 | notifier.moveWindow(mirWindowInfo1, toMirPoint(newPosition)); |
230 | 557 | flushEvents(); | ||
231 | 506 | 558 | ||
232 | 507 | EXPECT_EQ(newPosition, surface->position()); | 559 | EXPECT_EQ(newPosition, surface->position()); |
233 | 508 | } | 560 | } |
234 | @@ -526,6 +578,7 @@ | |||
235 | 526 | 578 | ||
236 | 527 | // Move window, check new position set | 579 | // Move window, check new position set |
237 | 528 | notifier.moveWindow(mirWindowInfo1, toMirPoint(QPoint(350, 420))); | 580 | notifier.moveWindow(mirWindowInfo1, toMirPoint(QPoint(350, 420))); |
238 | 581 | flushEvents(); | ||
239 | 529 | 582 | ||
240 | 530 | // Ensure other window untouched | 583 | // Ensure other window untouched |
241 | 531 | EXPECT_EQ(fixedPosition, surface->position()); | 584 | EXPECT_EQ(fixedPosition, surface->position()); |
242 | @@ -543,6 +596,7 @@ | |||
243 | 543 | 596 | ||
244 | 544 | auto mirWindowInfo1 = createMirALWindowInfo(QPoint(), size); | 597 | auto mirWindowInfo1 = createMirALWindowInfo(QPoint(), size); |
245 | 545 | notifier.addWindow(mirWindowInfo1); | 598 | notifier.addWindow(mirWindowInfo1); |
246 | 599 | flushEvents(); | ||
247 | 546 | 600 | ||
248 | 547 | auto surface = getMirSurfaceFromModel(model, 0); | 601 | auto surface = getMirSurfaceFromModel(model, 0); |
249 | 548 | EXPECT_EQ(size, surface->size()); | 602 | EXPECT_EQ(size, surface->size()); |
250 | @@ -563,8 +617,9 @@ | |||
251 | 563 | 617 | ||
252 | 564 | auto surface = getMirSurfaceFromModel(model, 0); | 618 | auto surface = getMirSurfaceFromModel(model, 0); |
253 | 565 | 619 | ||
255 | 566 | // Move window, check new position set | 620 | // Resize window, check new size set |
256 | 567 | notifier.resizeWindow(mirWindowInfo1, toMirSize(newSize)); | 621 | notifier.resizeWindow(mirWindowInfo1, toMirSize(newSize)); |
257 | 622 | flushEvents(); | ||
258 | 568 | 623 | ||
259 | 569 | EXPECT_EQ(newSize, surface->size()); | 624 | EXPECT_EQ(newSize, surface->size()); |
260 | 570 | } | 625 | } |
261 | @@ -586,8 +641,9 @@ | |||
262 | 586 | 641 | ||
263 | 587 | auto surface = getMirSurfaceFromModel(model, 0); | 642 | auto surface = getMirSurfaceFromModel(model, 0); |
264 | 588 | 643 | ||
266 | 589 | // Move window, check new position set | 644 | // Resize window, check new size set |
267 | 590 | notifier.resizeWindow(mirWindowInfo1, toMirSize(newSize)); | 645 | notifier.resizeWindow(mirWindowInfo1, toMirSize(newSize)); |
268 | 646 | flushEvents(); | ||
269 | 591 | 647 | ||
270 | 592 | EXPECT_EQ(newSize, surface->size()); | 648 | EXPECT_EQ(newSize, surface->size()); |
271 | 593 | } | 649 | } |
272 | @@ -595,23 +651,24 @@ | |||
273 | 595 | /* | 651 | /* |
274 | 596 | * Test: with 2 windows, ensure window resize does not impact other MirSurfaces | 652 | * Test: with 2 windows, ensure window resize does not impact other MirSurfaces |
275 | 597 | */ | 653 | */ |
277 | 598 | TEST_F(WindowModelTest, DISABLED_WindowResizeDoesNotTouchOtherMirSurfaces) | 654 | TEST_F(WindowModelTest, WindowResizeDoesNotTouchOtherMirSurfaces) |
278 | 599 | { | 655 | { |
279 | 600 | WindowModelNotifier notifier; | 656 | WindowModelNotifier notifier; |
280 | 601 | WindowModel model(¬ifier, nullptr); // no need for controller in this testcase | 657 | WindowModel model(¬ifier, nullptr); // no need for controller in this testcase |
281 | 602 | 658 | ||
283 | 603 | QSize fixedPosition(300, 400); | 659 | QSize fixedSize(300, 400); |
284 | 604 | 660 | ||
285 | 605 | auto mirWindowInfo1 = createMirALWindowInfo(QPoint(), QSize(100, 200)); | 661 | auto mirWindowInfo1 = createMirALWindowInfo(QPoint(), QSize(100, 200)); |
287 | 606 | auto mirWindowInfo2 = createMirALWindowInfo(QPoint(), fixedPosition); | 662 | auto mirWindowInfo2 = createMirALWindowInfo(QPoint(), fixedSize); |
288 | 607 | notifier.addWindow(mirWindowInfo1); | 663 | notifier.addWindow(mirWindowInfo1); |
289 | 608 | notifier.addWindow(mirWindowInfo2); | 664 | notifier.addWindow(mirWindowInfo2); |
290 | 609 | 665 | ||
291 | 610 | auto surface = getMirSurfaceFromModel(model, 1); | 666 | auto surface = getMirSurfaceFromModel(model, 1); |
292 | 611 | 667 | ||
294 | 612 | // Move window | 668 | // Resize window |
295 | 613 | notifier.resizeWindow(mirWindowInfo1, toMirSize(QSize(150, 220))); | 669 | notifier.resizeWindow(mirWindowInfo1, toMirSize(QSize(150, 220))); |
296 | 670 | flushEvents(); | ||
297 | 614 | 671 | ||
298 | 615 | // Ensure other window untouched | 672 | // Ensure other window untouched |
300 | 616 | EXPECT_EQ(fixedPosition, surface->size()); | 673 | EXPECT_EQ(fixedSize, surface->size()); |
301 | 617 | } | 674 | } |
I could add functions to wrap each notifier.* method with flush() call, but wasn't sure the test readability would be enhanced. Second opinion desired.