Mir

Merge lp:~brandontschaefer/mir/wait-surface-fullscreen-fix-test into lp:mir

Proposed by Brandon Schaefer
Status: Merged
Merged at revision: 3115
Proposed branch: lp:~brandontschaefer/mir/wait-surface-fullscreen-fix-test
Merge into: lp:mir
Diff against target: 20 lines (+10/-0)
1 file modified
tests/acceptance-tests/test_surface_raise.cpp (+10/-0)
To merge this branch: bzr merge lp:~brandontschaefer/mir/wait-surface-fullscreen-fix-test
Reviewer Review Type Date Requested Status
Kevin DuBois (community) Approve
Alan Griffiths Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Chris Halse Rogers Approve
Review via email: mp+277647@code.launchpad.net

Commit message

Need to wait for the surfaces to be fullscreen before we do any kind of pointer events!

Description of the change

Need to wait for the surfaces to be fullscreen before we do any kind of pointer events!

To post a comment you must log in.
Revision history for this message
Chris Halse Rogers (raof) wrote :

Eh, sure.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

OK. (Although it isn't obvious that "surface_fullscreen" is needed or has the right cardinality.)

review: Approve
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

surface_fullscreen isnt 100% needed but it at lease asserts the surfaces are fullscreen before we start the tests.

A better name could be surfaces_become_fullscreen

Revision history for this message
Kevin DuBois (kdub) wrote :

change is an improvement, but could there be further races around the visibility of the surfaces? ie, if we changed the server to service the swap buffers after the fullscreen request, the surface could still be hidden and miss the fake input injection. I have a round of fixes to similar situations in other test suites coming around, so lgtm, and I'll revisit that race when proposing those other fixes.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/acceptance-tests/test_surface_raise.cpp'
2--- tests/acceptance-tests/test_surface_raise.cpp 2015-11-05 04:13:48 +0000
3+++ tests/acceptance-tests/test_surface_raise.cpp 2015-11-17 05:08:50 +0000
4@@ -66,6 +66,16 @@
5 mir_surface_apply_spec(surface1, spec);
6 mir_surface_apply_spec(surface2, spec);
7 mir_surface_spec_release(spec);
8+
9+ bool surface_fullscreen = mt::spin_wait_for_condition_or_timeout(
10+ [this]
11+ {
12+ return mir_surface_get_state(surface1) == mir_surface_state_fullscreen &&
13+ mir_surface_get_state(surface2) == mir_surface_state_fullscreen;
14+ },
15+ std::chrono::seconds{max_wait});
16+
17+ EXPECT_TRUE(surface_fullscreen);
18
19 mir_connection_set_lifecycle_event_callback(connection, lifecycle_changed, this);
20 }

Subscribers

People subscribed via source and target branches