|
|
|
|
@ -1186,6 +1186,18 @@ MUNIT_TEST(test_passive_ei_device_keyboard_key)
|
|
|
|
|
peck_enable_ei_behavior(peck, PECK_EI_BEHAVIOR_AUTODEVICES);
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_keyboard(peck);
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
_unref_(ei_event) *start =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_START_EMULATING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_keyboard(peck);
|
|
|
|
|
eis_device_keyboard_key(device, KEY_Q, true);
|
|
|
|
|
@ -1221,6 +1233,18 @@ MUNIT_TEST(test_passive_ei_device_pointer_rel)
|
|
|
|
|
peck_enable_ei_behavior(peck, PECK_EI_BEHAVIOR_AUTODEVICES);
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
_unref_(ei_event) *start =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_START_EMULATING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
eis_device_pointer_motion(device, 1, 2);
|
|
|
|
|
@ -1264,6 +1288,18 @@ MUNIT_TEST(test_passive_ei_device_pointer_abs)
|
|
|
|
|
peck_enable_ei_behavior(peck, PECK_EI_BEHAVIOR_AUTODEVICES);
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer_absolute(peck);
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
_unref_(ei_event) *start =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_START_EMULATING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
device = peck_eis_get_default_pointer_absolute(peck);
|
|
|
|
|
|
|
|
|
|
@ -1332,6 +1368,18 @@ MUNIT_TEST(test_passive_ei_device_pointer_scroll)
|
|
|
|
|
peck_enable_ei_behavior(peck, PECK_EI_BEHAVIOR_AUTODEVICES);
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
_unref_(ei_event) *start =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_START_EMULATING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
eis_device_pointer_scroll(device, 1.1, 2.2);
|
|
|
|
|
@ -1367,6 +1415,18 @@ MUNIT_TEST(test_passive_ei_device_pointer_scroll_stop)
|
|
|
|
|
peck_enable_ei_behavior(peck, PECK_EI_BEHAVIOR_AUTODEVICES);
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
_unref_(ei_event) *start =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_START_EMULATING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
eis_device_pointer_scroll(device, 1.1, 2.2);
|
|
|
|
|
@ -1437,6 +1497,18 @@ MUNIT_TEST(test_passive_ei_device_pointer_scroll_cancel)
|
|
|
|
|
peck_enable_ei_behavior(peck, PECK_EI_BEHAVIOR_AUTODEVICES);
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
_unref_(ei_event) *start =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_START_EMULATING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
eis_device_pointer_scroll(device, 1.1, 2.2);
|
|
|
|
|
@ -1507,6 +1579,18 @@ MUNIT_TEST(test_passive_ei_device_pointer_scroll_stop_cancel)
|
|
|
|
|
peck_enable_ei_behavior(peck, PECK_EI_BEHAVIOR_AUTODEVICES);
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
_unref_(ei_event) *start =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_START_EMULATING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* cancel after stop is fine, stop after cancel is ignored */
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_pointer(peck);
|
|
|
|
|
@ -1568,6 +1652,18 @@ MUNIT_TEST(test_passive_ei_device_touch)
|
|
|
|
|
peck_enable_ei_behavior(peck, PECK_EI_BEHAVIOR_AUTODEVICES);
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
device = peck_eis_get_default_touch(peck);
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
_unref_(ei_event) *start =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_START_EMULATING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
device = peck_eis_get_default_touch(peck);
|
|
|
|
|
/* We know our default device has one region */
|
|
|
|
|
@ -1576,6 +1672,8 @@ MUNIT_TEST(test_passive_ei_device_touch)
|
|
|
|
|
maxx = eis_region_get_x(r) + eis_region_get_width(r);
|
|
|
|
|
maxy = eis_region_get_y(r) + eis_region_get_height(r);
|
|
|
|
|
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
|
|
|
|
|
_unref_(eis_touch) *t = eis_device_touch_new(device);
|
|
|
|
|
eis_touch_down(t, 1, 2);
|
|
|
|
|
eis_device_frame(device);
|
|
|
|
|
@ -1731,7 +1829,6 @@ MUNIT_TEST(test_passive_ei_device_touch)
|
|
|
|
|
MUNIT_TEST(test_passive_ei_device_multitouch)
|
|
|
|
|
{
|
|
|
|
|
_unref_(peck) *peck = peck_new_context(PECK_EI_PASSIVE);
|
|
|
|
|
struct ei_device *device = NULL;
|
|
|
|
|
|
|
|
|
|
peck_enable_eis_behavior(peck, PECK_EIS_BEHAVIOR_ACCEPT_ALL);
|
|
|
|
|
peck_enable_eis_behavior(peck, PECK_EIS_BEHAVIOR_ADD_TOUCH);
|
|
|
|
|
@ -1740,45 +1837,53 @@ MUNIT_TEST(test_passive_ei_device_multitouch)
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
device = peck_ei_get_default_touch(peck);
|
|
|
|
|
_unref_(ei_touch) *t1 = ei_device_touch_new(device);
|
|
|
|
|
_unref_(ei_touch) *t2 = ei_device_touch_new(device);
|
|
|
|
|
ei_touch_down(t1, 1, 2);
|
|
|
|
|
ei_device_frame(device);
|
|
|
|
|
ei_touch_motion(t1, 2, 3);
|
|
|
|
|
ei_device_frame(device);
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
struct eis_device *device = peck_eis_get_default_touch(peck);
|
|
|
|
|
_unref_(eis_touch) *t1 = eis_device_touch_new(device);
|
|
|
|
|
_unref_(eis_touch) *t2 = eis_device_touch_new(device);
|
|
|
|
|
eis_device_start_emulating(device);
|
|
|
|
|
eis_touch_down(t1, 1, 2);
|
|
|
|
|
eis_device_frame(device);
|
|
|
|
|
eis_touch_motion(t1, 2, 3);
|
|
|
|
|
eis_device_frame(device);
|
|
|
|
|
|
|
|
|
|
ei_touch_down(t2, 3, 4);
|
|
|
|
|
ei_device_frame(device);
|
|
|
|
|
ei_touch_motion(t2, 4, 5);
|
|
|
|
|
ei_device_frame(device);
|
|
|
|
|
eis_touch_down(t2, 3, 4);
|
|
|
|
|
eis_device_frame(device);
|
|
|
|
|
eis_touch_motion(t2, 4, 5);
|
|
|
|
|
eis_device_frame(device);
|
|
|
|
|
|
|
|
|
|
ei_touch_up(t2);
|
|
|
|
|
ei_touch_up(t1);
|
|
|
|
|
eis_touch_up(t2);
|
|
|
|
|
eis_touch_up(t1);
|
|
|
|
|
eis_device_stop_emulating(device);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peck_dispatch_until_stable(peck);
|
|
|
|
|
|
|
|
|
|
with_server(peck) {
|
|
|
|
|
_unref_(eis_event) *down1 = peck_eis_touch_down(eis, 1, 2);
|
|
|
|
|
uint32_t tid1 = eis_event_touch_get_id(down1);
|
|
|
|
|
with_client(peck) {
|
|
|
|
|
_unref_(ei_event) *start =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_START_EMULATING);
|
|
|
|
|
|
|
|
|
|
_unref_(eis_event) *motion1 = peck_eis_touch_motion(eis, 2, 3);
|
|
|
|
|
munit_assert_uint32(eis_event_touch_get_id(motion1), ==, tid1);
|
|
|
|
|
_unref_(ei_event) *down1 = peck_ei_touch_down(ei, 1, 2);
|
|
|
|
|
uint32_t tid1 = ei_event_touch_get_id(down1);
|
|
|
|
|
|
|
|
|
|
_unref_(eis_event) *down2 = peck_eis_touch_down(eis, 3, 4);
|
|
|
|
|
uint32_t tid2 = eis_event_touch_get_id(down2);
|
|
|
|
|
_unref_(ei_event) *motion1 = peck_ei_touch_motion(ei, 2, 3);
|
|
|
|
|
munit_assert_uint32(ei_event_touch_get_id(motion1), ==, tid1);
|
|
|
|
|
|
|
|
|
|
_unref_(ei_event) *down2 = peck_ei_touch_down(ei, 3, 4);
|
|
|
|
|
uint32_t tid2 = ei_event_touch_get_id(down2);
|
|
|
|
|
munit_assert_uint32(tid2, !=, tid1);
|
|
|
|
|
|
|
|
|
|
_unref_(eis_event) *motion2 = peck_eis_touch_motion(eis, 4, 5);
|
|
|
|
|
munit_assert_uint32(eis_event_touch_get_id(motion2), ==, tid2);
|
|
|
|
|
_unref_(ei_event) *motion2 = peck_ei_touch_motion(ei, 4, 5);
|
|
|
|
|
munit_assert_uint32(ei_event_touch_get_id(motion2), ==, tid2);
|
|
|
|
|
|
|
|
|
|
_unref_(eis_event) *up2 = peck_eis_touch_up(eis);
|
|
|
|
|
munit_assert_uint32(eis_event_touch_get_id(up2), ==, tid2);
|
|
|
|
|
_unref_(ei_event) *up2 = peck_ei_touch_up(ei);
|
|
|
|
|
munit_assert_uint32(ei_event_touch_get_id(up2), ==, tid2);
|
|
|
|
|
|
|
|
|
|
_unref_(eis_event) *up1 = peck_eis_touch_up(eis);
|
|
|
|
|
munit_assert_uint32(eis_event_touch_get_id(up1), ==, tid1);
|
|
|
|
|
_unref_(ei_event) *up1 = peck_ei_touch_up(ei);
|
|
|
|
|
munit_assert_uint32(ei_event_touch_get_id(up1), ==, tid1);
|
|
|
|
|
|
|
|
|
|
_unref_(ei_event) *stop =
|
|
|
|
|
peck_ei_next_event(ei, EI_EVENT_DEVICE_STOP_EMULATING);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return MUNIT_OK;
|
|
|
|
|
|