test-client: Make sure we process pending eevents before we verify state

Since the send-button-state request comes in on one socket and the
wayland event we're looking for comes in on another socket, the order
that we process the two in is undefined.  Thus, button-test fails
intermittently, depending on which event we process first.

We change wl_display_flush() to wl_display_roundtrip(), to make sure that
we deal with all wayland events before handling test protocol requests.
This commit is contained in:
Kristian Høgsberg 2012-10-21 22:30:26 -04:00
parent 1d1e0a5ffa
commit 128ee2c342

View File

@ -355,7 +355,7 @@ send_button_state(int fd, struct display *display)
char buf[64];
int len;
wl_display_flush(display->display);
wl_display_roundtrip(display->display);
len = snprintf(buf, sizeof buf, "%u\n", display->input->button_mask);
assert(write(fd, buf, len) == len);