mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-11 13:10:17 +01:00
test: switch to use ei_seat_bind_capabilities()
Better than one-by-one where we bind multiple capabilities. And ei_seat_bind_capability() is about to be removed so let's switch all of them.
This commit is contained in:
parent
4adf483195
commit
44de97d649
3 changed files with 24 additions and 22 deletions
|
|
@ -44,8 +44,8 @@ MUNIT_TEST(test_ei_seat_bind_unbind)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *event = peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
seat = ei_seat_ref(ei_event_get_seat(event));
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_KEYBOARD);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_POINTER,
|
||||
EI_DEVICE_CAP_KEYBOARD, NULL);
|
||||
}
|
||||
|
||||
/* server has the Bind event now and creates devices */
|
||||
|
|
@ -60,8 +60,8 @@ MUNIT_TEST(test_ei_seat_bind_unbind)
|
|||
dev1 = ei_device_ref(ei_event_get_device(e1));
|
||||
dev2 = ei_device_ref(ei_event_get_device(e2));
|
||||
|
||||
ei_seat_unbind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_unbind_capability(seat, EI_DEVICE_CAP_KEYBOARD);
|
||||
ei_seat_unbind_capabilities(seat, EI_DEVICE_CAP_POINTER,
|
||||
EI_DEVICE_CAP_KEYBOARD, NULL);
|
||||
}
|
||||
|
||||
/* Dispatch, server is aware of the ei_seat_unbind() */
|
||||
|
|
@ -101,8 +101,8 @@ MUNIT_TEST(test_ei_seat_bind_unbind_noref)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *event = peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
seat = ei_seat_ref(ei_event_get_seat(event));
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_KEYBOARD);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_POINTER,
|
||||
EI_DEVICE_CAP_KEYBOARD, NULL);
|
||||
}
|
||||
|
||||
/* server has the Bind event now and creates devices */
|
||||
|
|
@ -119,8 +119,8 @@ MUNIT_TEST(test_ei_seat_bind_unbind_noref)
|
|||
* one ref inside libei for this seat, so this tests ensures
|
||||
* we don't rely on a caller ref to keep everything alive. */
|
||||
ei_seat_unref(seat);
|
||||
ei_seat_unbind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_unbind_capability(seat, EI_DEVICE_CAP_KEYBOARD);
|
||||
ei_seat_unbind_capabilities(seat, EI_DEVICE_CAP_POINTER,
|
||||
EI_DEVICE_CAP_KEYBOARD, NULL);
|
||||
}
|
||||
|
||||
/* Dispatch, server is aware of the ei_seat_unbind() */
|
||||
|
|
@ -150,10 +150,10 @@ MUNIT_TEST(test_ei_seat_bind_unbind_immediately)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *event = peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
seat = ei_event_get_seat(event);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_KEYBOARD);
|
||||
ei_seat_unbind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_unbind_capability(seat, EI_DEVICE_CAP_KEYBOARD);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_POINTER,
|
||||
EI_DEVICE_CAP_KEYBOARD, NULL);
|
||||
ei_seat_unbind_capabilities(seat, EI_DEVICE_CAP_POINTER,
|
||||
EI_DEVICE_CAP_KEYBOARD, NULL);
|
||||
}
|
||||
|
||||
peck_dispatch_until_stable(peck);
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ MUNIT_TEST(test_ei_disconnect_after_bind_before_received)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *event = peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
struct ei_seat *seat = ei_event_get_seat(event);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_POINTER, NULL);
|
||||
}
|
||||
|
||||
/* We have *not* called eis_dispatch, so the seat bind hasn't been
|
||||
|
|
@ -271,7 +271,7 @@ MUNIT_TEST(test_ei_disconnect_self_after_bind_before_received)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *event = peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
struct ei_seat *seat = ei_event_get_seat(event);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_POINTER, NULL);
|
||||
/* Disconnect before the server can process the bind event */
|
||||
peck_drop_ei(peck);
|
||||
ei_unref(ei);
|
||||
|
|
@ -310,7 +310,7 @@ MUNIT_TEST(test_ei_disconnect_after_bind_after_received)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *event = peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
struct ei_seat *seat = ei_event_get_seat(event);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_POINTER, NULL);
|
||||
}
|
||||
|
||||
/* Receive the Bind event but don't actually add any devices,
|
||||
|
|
@ -346,7 +346,7 @@ MUNIT_TEST(test_ei_disconnect_self_after_bind_after_received)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *event = peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
struct ei_seat *seat = ei_event_get_seat(event);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_POINTER, NULL);
|
||||
}
|
||||
|
||||
/* Make sure server sees Bind, then disconnect from server */
|
||||
|
|
@ -388,7 +388,7 @@ MUNIT_TEST(test_ei_disconnect_after_unbind_before_received)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *event = peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
seat = ei_seat_ref(ei_event_get_seat(event));
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_POINTER, NULL);
|
||||
}
|
||||
|
||||
peck_enable_eis_behavior(peck, PECK_EIS_BEHAVIOR_ACCEPT_ALL);
|
||||
|
|
@ -397,7 +397,8 @@ MUNIT_TEST(test_ei_disconnect_after_unbind_before_received)
|
|||
peck_dispatch_until_stable(peck);
|
||||
|
||||
with_client(peck) {
|
||||
ei_seat_unbind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_unbind_capabilities(seat, EI_DEVICE_CAP_POINTER,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* No server dispatch here so the server isn't aware of the
|
||||
|
|
@ -432,14 +433,15 @@ MUNIT_TEST(test_ei_disconnect_after_unbind_after_received)
|
|||
with_client(peck) {
|
||||
_unref_(ei_event) *event = peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
seat = ei_seat_ref(ei_event_get_seat(event));
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_POINTER, NULL);
|
||||
}
|
||||
|
||||
/* server has the Bind event now */
|
||||
peck_dispatch_until_stable(peck);
|
||||
|
||||
with_client(peck) {
|
||||
ei_seat_unbind_capability(seat, EI_DEVICE_CAP_POINTER);
|
||||
ei_seat_unbind_capabilities(seat, EI_DEVICE_CAP_POINTER,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/* Dispatch, server is aware of the ei_seat_unbind() */
|
||||
|
|
|
|||
|
|
@ -137,8 +137,8 @@ MUNIT_TEST(eistest_cliend_bind_some_caps)
|
|||
_unref_(ei_event) *event =
|
||||
peck_ei_next_event(ei, EI_EVENT_SEAT_ADDED);
|
||||
struct ei_seat *seat = ei_event_get_seat(event);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_KEYBOARD);
|
||||
ei_seat_bind_capability(seat, EI_DEVICE_CAP_TOUCH);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_KEYBOARD, NULL);
|
||||
ei_seat_bind_capabilities(seat, EI_DEVICE_CAP_TOUCH, NULL);
|
||||
}
|
||||
|
||||
peck_dispatch_until_stable(peck);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue