608
608
launch_client_process(*client_config_1);
609
609
launch_client_process(*client_config_2);
612
TEST_F(TestClientInput, clients_receive_motion_within_co_ordinate_system_of_window)
614
using namespace ::testing;
616
static int const screen_width = 1000;
617
static int const screen_height = 800;
618
static int const client_height = screen_height/2;
619
static int const client_width = screen_width/2;
620
static std::string const test_client = "tc";
621
mtf::CrossProcessSync fence;
623
static GeometryMap positions;
624
positions[test_client] = geom::Rectangle{geom::Point{screen_width/2, screen_height/2},
625
geom::Size{client_width, client_height}};
627
auto server_config = make_event_producing_server(fence, 1,
628
[&](mtf::InputTestingServerConfiguration& server)
630
server.the_session_container()->for_each([&](std::shared_ptr<msh::Session> const& session) -> void
632
session->default_surface()->move_to(geom::Point{screen_width/2-40, screen_height/2-80});
634
server.fake_event_hub->synthesize_event(mis::a_motion_event().with_movement(screen_width/2+40, screen_height/2+90));
635
}, positions, DepthMap());
636
launch_server_process(*server_config);
638
auto client = make_event_expecting_client(test_client, fence,
639
[&](MockHandler& handler, mt::WaitCondition& events_received)
642
EXPECT_CALL(handler, handle_input(mt::HoverEnterEvent())).Times(1);
643
EXPECT_CALL(handler, handle_input(mt::MotionEventWithPosition(80, 170))).Times(AnyNumber())
644
.WillOnce(mt::WakeUp(&events_received));
647
launch_client_process(*client);