Mir

Merge lp:~mir-team/mir/fix-1407883 into lp:mir

Proposed by Robert Carr on 2015-01-07
Status: Merged
Approved by: Robert Carr on 2015-01-07
Approved revision: 2201
Merged at revision: 2203
Proposed branch: lp:~mir-team/mir/fix-1407883
Merge into: lp:mir
Diff against target: 53 lines (+10/-4)
1 file modified
tests/acceptance-tests/throwback/test_client_input.cpp (+10/-4)
To merge this branch: bzr merge lp:~mir-team/mir/fix-1407883
Reviewer Review Type Date Requested Status
Kevin DuBois (community) 2015-01-07 Approve on 2015-01-07
Daniel van Vugt 2015-01-07 Approve on 2015-01-07
PS Jenkins bot continuous-integration Approve on 2015-01-07
Review via email: mp+245703@code.launchpad.net

Commit Message

TestClientInput: When revealing hidden surfaces wait for them to become exposed before sending events which we expect them to receive
(LP: #1407783)

Description of the Change

Fix TestClientInput failure (LP: #1407783) as described here: https://bugs.launchpad.net/mir/+bug/1408168 (?)

To post a comment you must log in.
Daniel van Vugt (vanvugt) wrote :

I've linked to the two aforementioned bugs. Is that right?

review: Needs Information
Daniel van Vugt (vanvugt) wrote :

Typo in branch name ;)

But the results speak for themselves. Running TestClientInput 1000 times, the pass rates are:
Without this branch: 98% (20 failures)
With this branch...: 100% (0 failures)

review: Approve
Daniel van Vugt (vanvugt) wrote :

Or a larger test run (5000x):

Without this branch: 97.2%
With this branch: 100%

Daniel van Vugt (vanvugt) wrote :

Unlinked bug 1408168. Obviously only fixing the test here, bug 1408168 isn't being fixed.

Kevin DuBois (kdub) wrote :

okay

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/throwback/test_client_input.cpp'
2--- tests/acceptance-tests/throwback/test_client_input.cpp 2014-12-15 06:24:03 +0000
3+++ tests/acceptance-tests/throwback/test_client_input.cpp 2015-01-07 00:57:20 +0000
4@@ -85,14 +85,14 @@
5 auto spec = mir_connection_create_spec_for_normal_surface(connection, surface_width,
6 surface_height, mir_pixel_format_bgr_888);
7 mir_surface_spec_set_name(spec, client_name.c_str());
8- auto surface = mir_surface_create_sync(spec);
9+ surface = mir_surface_create_sync(spec);
10 mir_surface_spec_release(spec);
11
12 MirEventDelegate const event_delegate { handle_input, this };
13 mir_surface_set_event_handler(surface, &event_delegate);
14 mir_surface_swap_buffers_sync(surface);
15
16- wait_for_surface_to_become_focused_and_exposed(surface);
17+ wait_for_surface_to_become_focused_and_exposed();
18
19 ready_to_accept_events.wake_up_everyone();
20 all_events_received.wait_for_at_most_seconds(10);
21@@ -111,10 +111,10 @@
22 client->handler.handle_input(ev);
23 }
24
25- void wait_for_surface_to_become_focused_and_exposed(MirSurface* surface)
26+ void wait_for_surface_to_become_focused_and_exposed()
27 {
28 bool success = mt::spin_wait_for_condition_or_timeout(
29- [surface]
30+ [&]
31 {
32 return mir_surface_get_visibility(surface) == mir_surface_visibility_exposed &&
33 mir_surface_get_focus(surface) == mir_surface_focused;
34@@ -135,6 +135,8 @@
35 MockInputHandler handler;
36 mir::test::WaitCondition all_events_received;
37 mir::test::WaitCondition ready_to_accept_events;
38+
39+ MirSurface* surface;
40 };
41
42 using ClientInputRegions = std::map<std::string, std::vector<geom::Rectangle>>;
43@@ -501,6 +503,10 @@
44 if (session->name() == test_client_name_2)
45 session->hide();
46 });
47+ // As the surface will not be unocludded immediately when the other surface is
48+ // hidden (due to the compositor feedback approach used)
49+ // See bug: https://bugs.launchpad.net/mir/+bug/1408168
50+ client1.wait_for_surface_to_become_focused_and_exposed();
51
52 fake_event_hub()->synthesize_event(mis::a_motion_event().with_movement(1,1));
53 }

Subscribers

People subscribed via source and target branches