summaryrefslogtreecommitdiff
path: root/tests/wayland/test_app_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wayland/test_app_input.c')
-rw-r--r--tests/wayland/test_app_input.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/wayland/test_app_input.c b/tests/wayland/test_app_input.c
index 843f38d..88f9ead 100644
--- a/tests/wayland/test_app_input.c
+++ b/tests/wayland/test_app_input.c
@@ -26,6 +26,15 @@ static void push_key(struct yasl_surface *s)
static enum yasl_app_result on_init(void *ud, struct yasl_display *d)
{
struct test_state *state = ud;
+ if (state->end == 3) {
+ /* With no event callback, a close request alone stops the runner. */
+ struct yasl_surface *s = yasl_surface_create_toplevel(d,
+ &(struct yasl_window_spec){ .title = "App Close Test", .size = {64, 64} });
+ assert(s);
+ struct wayland_surface *w = (struct wayland_surface *)s;
+ w->cbs->close(s, w->ud);
+ return YASL_APP_CONTINUE;
+ }
if (state->end) {
struct wayland_display *display = (struct wayland_display *)d;
if (state->end == 1)
@@ -107,5 +116,10 @@ int main(void)
});
assert(end == 1 ? res == 0 : res < 0);
}
+ state = (struct test_state){.end = 3};
+ res = yasl_run(&(struct yasl_app_desc){
+ .backend = YASL_BACKEND_WAYLAND, .userdata = &state, .init = on_init,
+ });
+ assert(res == 0);
return 0;
}