Mir

Merge lp:~afrantzis/mir/fix-1318587 into lp:mir

Proposed by Alexandros Frantzis
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 1624
Proposed branch: lp:~afrantzis/mir/fix-1318587
Merge into: lp:mir
Diff against target: 41 lines (+13/-1)
1 file modified
tests/acceptance-tests/test_custom_input_dispatcher.cpp (+13/-1)
To merge this branch: bzr merge lp:~afrantzis/mir/fix-1318587
Reviewer Review Type Date Requested Status
Alberto Aguirre (community) Approve
Kevin DuBois (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+219180@code.launchpad.net

Commit message

tests: Allow more time for event handling to happen before leaving the CustomInputDispatcherFixture.custom_input_dispatcher_receives_input test

Description of the change

tests: Allow more time for event handling to happen before leaving the CustomInputDispatcherFixture.custom_input_dispatcher_receives_input test

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

looks okay

review: Approve
Revision history for this message
Alberto Aguirre (albaguirre) wrote :

ok

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/acceptance-tests/test_custom_input_dispatcher.cpp'
--- tests/acceptance-tests/test_custom_input_dispatcher.cpp 2014-05-09 09:56:45 +0000
+++ tests/acceptance-tests/test_custom_input_dispatcher.cpp 2014-05-12 12:20:04 +0000
@@ -23,6 +23,7 @@
2323
24#include "mir_test_framework/display_server_test_fixture.h"24#include "mir_test_framework/display_server_test_fixture.h"
25#include "mir_test_framework/input_testing_server_configuration.h"25#include "mir_test_framework/input_testing_server_configuration.h"
26#include "mir_test_framework/cross_process_sync.h"
26#include "mir_test_doubles/mock_input_dispatcher.h"27#include "mir_test_doubles/mock_input_dispatcher.h"
27#include "mir_test/fake_shared.h"28#include "mir_test/fake_shared.h"
28#include "mir_test/fake_event_hub.h"29#include "mir_test/fake_event_hub.h"
@@ -108,7 +109,8 @@
108 using namespace ::testing;109 using namespace ::testing;
109 InSequence seq;110 InSequence seq;
110 EXPECT_CALL(dispatcher_conf->dispatcher, dispatch(mt::MotionEventWithPosition(1, 1))).Times(1);111 EXPECT_CALL(dispatcher_conf->dispatcher, dispatch(mt::MotionEventWithPosition(1, 1))).Times(1);
111 EXPECT_CALL(dispatcher_conf->dispatcher, dispatch(mt::KeyDownEvent())).Times(1);112 EXPECT_CALL(dispatcher_conf->dispatcher, dispatch(mt::KeyDownEvent()))
113 .WillOnce(InvokeWithoutArgs([this] { dispatching_done.signal_ready(); }));
112 }114 }
113115
114 return dispatcher_conf;116 return dispatcher_conf;
@@ -119,9 +121,19 @@
119 fake_event_hub->synthesize_event(mis::a_motion_event().with_movement(1, 1));121 fake_event_hub->synthesize_event(mis::a_motion_event().with_movement(1, 1));
120 fake_event_hub->synthesize_event(mis::a_key_down_event().of_scancode(KEY_ENTER));122 fake_event_hub->synthesize_event(mis::a_key_down_event().of_scancode(KEY_ENTER));
121 }123 }
124
125 mtf::CrossProcessSync dispatching_done;
122 } server_config;126 } server_config;
123127
124 launch_server_process(server_config);128 launch_server_process(server_config);
129
130 // Since event handling happens asynchronously we need to allow some time
131 // for it to take place before we leave the test. Otherwise, the server
132 // may be stopped before events have been dispatched.
133 run_in_test_process([&]
134 {
135 server_config.dispatching_done.wait_for_signal_ready_for(std::chrono::seconds{5});
136 });
125}137}
126138
127TEST_F(CustomInputDispatcherFixture, custom_input_dispatcher_gets_started_and_stopped)139TEST_F(CustomInputDispatcherFixture, custom_input_dispatcher_gets_started_and_stopped)

Subscribers

People subscribed via source and target branches