mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 06:28:01 +02:00
tests: Add test for seat destruction and creation
Add a test to check that we can destroy and create the test seat. Since after test seat destruction the test client releases any associated input resources, this test also checks that libweston properly handles release requests for inert input resources. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
849b333133
commit
8b964bca50
1 changed files with 22 additions and 0 deletions
|
|
@ -322,3 +322,25 @@ TEST(seats_have_names)
|
|||
assert(input->seat_name);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(seat_destroy_and_recreate)
|
||||
{
|
||||
struct client *cl = create_client_and_test_surface(100, 100, 100, 100);
|
||||
|
||||
weston_test_device_release(cl->test->weston_test, "seat");
|
||||
/* Roundtrip to receive and handle the seat global removal event */
|
||||
client_roundtrip(cl);
|
||||
|
||||
assert(!cl->input);
|
||||
|
||||
weston_test_device_add(cl->test->weston_test, "seat");
|
||||
/* First roundtrip to send request and receive new seat global */
|
||||
client_roundtrip(cl);
|
||||
/* Second roundtrip to handle seat events and set up input devices */
|
||||
client_roundtrip(cl);
|
||||
|
||||
assert(cl->input);
|
||||
assert(cl->input->pointer);
|
||||
assert(cl->input->keyboard);
|
||||
assert(cl->input->touch);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue