[PATCH weston v2 7/7] tests: Add test for seat destruction and creation

Pekka Paalanen ppaalanen at gmail.com
Tue Feb 13 11:56:47 UTC 2018


On Thu,  8 Feb 2018 15:37:58 +0200
Alexandros Frantzis <alexandros.frantzis at collabora.com> wrote:

> 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 at collabora.com>
> ---
> Changes in v2:
>  - Add assertions for client->input state.
> 
>  tests/devices-test.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/tests/devices-test.c b/tests/devices-test.c
> index a6ec6eaf..147a2791 100644
> --- a/tests/devices-test.c
> +++ b/tests/devices-test.c
> @@ -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);
> +}

Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180213/23ff67a9/attachment.sig>


More information about the wayland-devel mailing list