diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-03-26 12:49:35 +0200 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2015-04-02 12:54:04 +0300 |
commit | 1ffd4615e84c03728ae13aa8343cce59ceeeeb49 (patch) | |
tree | be41a7e4ac0ed76c83291cef19ff7fd23ff30992 /tests | |
parent | 5fd814090e10fad6c39533852732c2bf4a967a7a (diff) | |
download | weston-1ffd4615e84c03728ae13aa8343cce59ceeeeb49.tar.gz |
tests: introduce create_client()
Introduce a new helper create_client(), which creates and initializes
the client struct, but does not create a wl_surface.
This will be useful for ivi-shell tests.
v2: Rebased, and restored the dependency to weston-test.so, since seat
handling requires it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/weston-test-client-helper.c | 17 | ||||
-rw-r--r-- | tests/weston-test-client-helper.h | 3 |
2 files changed, 17 insertions, 3 deletions
diff --git a/tests/weston-test-client-helper.c b/tests/weston-test-client-helper.c index 9a031e3e..84eae7e6 100644 --- a/tests/weston-test-client-helper.c +++ b/tests/weston-test-client-helper.c @@ -736,10 +736,9 @@ client_set_input(struct client *cl) } struct client * -client_create(int x, int y, int width, int height) +create_client(void) { struct client *client; - struct surface *surface; wl_log_set_handler_client(log_handler); @@ -752,7 +751,8 @@ client_create(int x, int y, int width, int height) /* setup registry so we can bind to interfaces */ client->wl_registry = wl_display_get_registry(client->wl_display); - wl_registry_add_listener(client->wl_registry, ®istry_listener, client); + wl_registry_add_listener(client->wl_registry, ®istry_listener, + client); /* this roundtrip makes sure we have all globals and we bound to them */ client_roundtrip(client); @@ -778,6 +778,17 @@ client_create(int x, int y, int width, int height) /* must have seat set */ assert(client->input); + return client; +} + +struct client * +client_create(int x, int y, int width, int height) +{ + struct client *client; + struct surface *surface; + + client = create_client(); + /* initialize the client surface */ surface = xzalloc(sizeof *surface); surface->wl_surface = diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h index 63883fe5..61c0b455 100644 --- a/tests/weston-test-client-helper.h +++ b/tests/weston-test-client-helper.h @@ -144,6 +144,9 @@ xzalloc(size_t size) } struct client * +create_client(void); + +struct client * client_create(int x, int y, int width, int height); struct wl_buffer * |