tests: use special seat

When running on different backends, we don't know what devices
the backend provides. Create new seat for tests that contains
everything what we need. This is also first step in adding
touch support for tests.

v2: do not add devices in wl_seat.name event. Collect first
    all wl_seats and then pick the one that we need and
    destroy the rest. The effect is the same, but this code
    is better understandable.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/tests/weston-test.c b/tests/weston-test.c
index eb431f3..9f1f49b 100644
--- a/tests/weston-test.c
+++ b/tests/weston-test.c
@@ -41,6 +41,7 @@
 	struct weston_compositor *compositor;
 	struct weston_layer layer;
 	struct weston_process process;
+	struct weston_seat seat;
 };
 
 struct weston_test_surface {
@@ -70,14 +71,7 @@
 static struct weston_seat *
 get_seat(struct weston_test *test)
 {
-	struct wl_list *seat_list;
-	struct weston_seat *seat;
-
-	seat_list = &test->compositor->seat_list;
-	assert(wl_list_length(seat_list) == 1);
-	seat = container_of(seat_list->next, struct weston_seat, link);
-
-	return seat;
+	return &test->seat;
 }
 
 static void
@@ -349,6 +343,14 @@
 			     test, bind_test) == NULL)
 		return -1;
 
+	/* create our own seat */
+	weston_seat_init(&test->seat, ec, "test-seat");
+
+	/* add devices */
+	weston_seat_init_pointer(&test->seat);
+	weston_seat_init_keyboard(&test->seat, NULL);
+	weston_seat_init_touch(&test->seat);
+
 	loop = wl_display_get_event_loop(ec->wl_display);
 	wl_event_loop_add_idle(loop, idle_launch_client, test);