summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-12-11 22:17:35 -0500
committerKristian Høgsberg <krh@bitplanet.net>2012-12-11 23:57:44 -0500
commit80004f2d9f4762f433e040c29bf31e47d58f005f (patch)
treef8e43e0a44ed1677d49ea41e2ed0c5ab8b5faf45
parentd001ebc77bc68bc844758f221495431cb83e1d26 (diff)
downloadweston-80004f2d9f4762f433e040c29bf31e47d58f005f.tar.gz
weston-80004f2d9f4762f433e040c29bf31e47d58f005f.tar.bz2
weston-80004f2d9f4762f433e040c29bf31e47d58f005f.zip
tests: Drop yield() helper function
Remaining use case was when we move the pointer. This doesn't change geometry so we can just use a wl_display_roundtrip() to make sure we get the request to the server and receive the resulting events.
-rw-r--r--tests/button-test.c3
-rw-r--r--tests/event-test.c3
-rw-r--r--tests/weston-test-client-helper.c23
-rw-r--r--tests/weston-test-client-helper.h6
4 files changed, 4 insertions, 31 deletions
diff --git a/tests/button-test.c b/tests/button-test.c
index 2bb2e7f5..ac75ee08 100644
--- a/tests/button-test.c
+++ b/tests/button-test.c
@@ -36,7 +36,8 @@ TEST(simple_button_test)
assert(pointer->button == 0);
assert(pointer->state == 0);
- move_pointer(client, 150, 150);
+ wl_test_move_pointer(client->test->wl_test, 150, 150);
+ wl_display_roundtrip(client->wl_display);
assert(pointer->x == 50);
assert(pointer->y == 50);
diff --git a/tests/event-test.c b/tests/event-test.c
index 4c992e4c..ba22f3f9 100644
--- a/tests/event-test.c
+++ b/tests/event-test.c
@@ -56,7 +56,8 @@ check_pointer(struct client *client, int x, int y)
static void
check_pointer_move(struct client *client, int x, int y)
{
- move_pointer(client, x, y);
+ wl_test_move_pointer(client->test->wl_test, x, y);
+ wl_display_roundtrip(client->wl_display);
check_pointer(client, x, y);
}
diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c
index 01405d83..45419fc4 100644
--- a/tests/weston-test-client-helper.c
+++ b/tests/weston-test-client-helper.c
@@ -40,29 +40,6 @@ surface_contains(struct surface *surface, int x, int y)
return x >= sx && y >= sy && x < sx + sw && y < sy + sh;
}
-void
-yield(struct client *client)
-{
- /*
- * FIXME: ugh! how do we ensure all events have finished
- * propagating to the client. The calls to usleep seem to do a
- * pretty reasonable job... and without them, tests can fail
- * intermittently.
- */
- usleep(0.02 * 1e6);
- wl_display_flush(client->wl_display);
- wl_display_roundtrip(client->wl_display);
- usleep(0.02 * 1e6);
-}
-
-void
-move_pointer(struct client *client, int x, int y)
-{
- wl_test_move_pointer(client->test->wl_test, x, y);
-
- yield(client);
-}
-
static void
move_client_frame_handler(void *data,
struct wl_callback *callback, uint32_t time)
diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h
index 582572d5..3e648ae6 100644
--- a/tests/weston-test-client-helper.h
+++ b/tests/weston-test-client-helper.h
@@ -97,12 +97,6 @@ int
surface_contains(struct surface *surface, int x, int y);
void
-yield(struct client *client);
-
-void
-move_pointer(struct client *client, int x, int y);
-
-void
move_client(struct client *client, int x, int y);