blob: 196e7f09e2eea9ce977b3cc541121c80ae065231 [file] [log] [blame]
Pekka Paalanenf5b74f72015-03-25 12:50:31 +02001/*
2 * Copyright © 2012 Intel Corporation
3 * Copyright © 2013 DENSO CORPORATION
4 * Copyright © 2015 Collabora, Ltd.
5 *
Bryce Harrington2cc92972015-06-11 15:39:40 -07006 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020013 *
Bryce Harrington2cc92972015-06-11 15:39:40 -070014 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
22 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020026 */
27
28#include "config.h"
29
Jussi Kukkonen649bbce2016-07-19 14:16:27 +030030#include <stdint.h>
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020031#include <unistd.h>
32#include <signal.h>
33#include <string.h>
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090034#include <assert.h>
Daniel Stonee03c1112016-11-24 20:45:45 +000035#include <limits.h>
Antonio Borneo39578632019-04-26 23:57:31 +020036#include <errno.h>
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020037
Pekka Paalanen3d5d9472019-03-28 16:28:47 +020038#include <libweston/libweston.h>
Pekka Paalanen58f98c92016-06-03 16:45:21 +030039#include "compositor/weston.h"
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020040#include "weston-test-server-protocol.h"
41#include "ivi-test.h"
Jon Cruz4678bab2015-06-15 15:37:07 -070042#include "ivi-shell/ivi-layout-export.h"
Jon Cruz867d50e2015-06-15 15:37:10 -070043#include "shared/helpers.h"
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020044
45struct test_context;
46
47struct runner_test {
48 const char *name;
49 void (*run)(struct test_context *);
50} __attribute__ ((aligned (32)));
51
52#define RUNNER_TEST(name) \
53 static void runner_func_##name(struct test_context *); \
54 \
55 const struct runner_test runner_test_##name \
Pekka Paalanene4f6f8c2019-11-11 15:18:51 +020056 __attribute__ ((section ("plugin_test_section"))) = \
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020057 { \
58 #name, runner_func_##name \
59 }; \
60 \
61 static void runner_func_##name(struct test_context *ctx)
62
Pekka Paalanene4f6f8c2019-11-11 15:18:51 +020063extern const struct runner_test __start_plugin_test_section;
64extern const struct runner_test __stop_plugin_test_section;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020065
66static const struct runner_test *
67find_runner_test(const char *name)
68{
69 const struct runner_test *t;
70
Pekka Paalanene4f6f8c2019-11-11 15:18:51 +020071 for (t = &__start_plugin_test_section;
72 t < &__stop_plugin_test_section; t++) {
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020073 if (strcmp(t->name, name) == 0)
74 return t;
75 }
76
77 return NULL;
78}
79
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090080struct test_context {
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +000081 const struct ivi_layout_interface *layout_interface;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090082 struct wl_resource *runner_resource;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +090083 uint32_t user_flags;
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +000084
85 struct wl_listener surface_property_changed;
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +000086 struct wl_listener surface_created;
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +000087 struct wl_listener surface_removed;
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +000088 struct wl_listener surface_configured;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090089};
90
Pekka Paalanend19c55c2019-11-05 16:32:18 +020091struct test_launcher {
92 struct weston_compositor *compositor;
Pekka Paalanen2dcc79f2021-06-14 14:47:32 +030093 struct wl_listener destroy_listener;
Pekka Paalanend19c55c2019-11-05 16:32:18 +020094 struct test_context context;
Pekka Paalanend19c55c2019-11-05 16:32:18 +020095 const struct ivi_layout_interface *layout_interface;
96};
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090097
98static void
99destroy_runner(struct wl_resource *resource)
100{
Pekka Paalanend19c55c2019-11-05 16:32:18 +0200101 struct test_launcher *launcher = wl_resource_get_user_data(resource);
102 struct test_context *ctx = &launcher->context;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900103
Pekka Paalanend19c55c2019-11-05 16:32:18 +0200104 assert(ctx->runner_resource == NULL ||
105 ctx->runner_resource == resource);
106
107 ctx->layout_interface = NULL;
108 ctx->runner_resource = NULL;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900109}
110
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200111static void
112runner_destroy_handler(struct wl_client *client, struct wl_resource *resource)
113{
114 wl_resource_destroy(resource);
115}
116
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200117static void
118runner_run_handler(struct wl_client *client, struct wl_resource *resource,
119 const char *test_name)
120{
121 struct test_launcher *launcher;
122 const struct runner_test *t;
Pekka Paalanend19c55c2019-11-05 16:32:18 +0200123 struct test_context *ctx;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200124
125 launcher = wl_resource_get_user_data(resource);
Pekka Paalanend19c55c2019-11-05 16:32:18 +0200126 ctx = &launcher->context;
127
128 assert(ctx->runner_resource == NULL ||
129 ctx->runner_resource == resource);
130
131 ctx->layout_interface = launcher->layout_interface;
132 ctx->runner_resource = resource;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200133
134 t = find_runner_test(test_name);
135 if (!t) {
136 weston_log("Error: runner test \"%s\" not found.\n",
137 test_name);
138 wl_resource_post_error(resource,
139 WESTON_TEST_RUNNER_ERROR_UNKNOWN_TEST,
140 "weston_test_runner: unknown: '%s'",
141 test_name);
142 return;
143 }
144
145 weston_log("weston_test_runner.run(\"%s\")\n", test_name);
146
Pekka Paalanend19c55c2019-11-05 16:32:18 +0200147 t->run(ctx);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200148
149 weston_test_runner_send_finished(resource);
150}
151
152static const struct weston_test_runner_interface runner_implementation = {
153 runner_destroy_handler,
154 runner_run_handler
155};
156
157static void
158bind_runner(struct wl_client *client, void *data,
159 uint32_t version, uint32_t id)
160{
161 struct test_launcher *launcher = data;
162 struct wl_resource *resource;
163
164 resource = wl_resource_create(client, &weston_test_runner_interface,
165 1, id);
166 if (!resource) {
167 wl_client_post_no_memory(client);
168 return;
169 }
170
171 wl_resource_set_implementation(resource, &runner_implementation,
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900172 launcher, destroy_runner);
173
Pekka Paalanend19c55c2019-11-05 16:32:18 +0200174 if (launcher->context.runner_resource != NULL) {
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900175 weston_log("test FATAL: "
176 "attempting to run several tests in parallel.\n");
177 wl_resource_post_error(resource,
178 WESTON_TEST_RUNNER_ERROR_TEST_FAILED,
179 "attempt to run parallel tests");
180 }
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200181}
182
Pekka Paalanen2dcc79f2021-06-14 14:47:32 +0300183static void
184test_launcher_destroy(struct wl_listener *l, void *data)
185{
186 struct test_launcher *launcher;
187
188 launcher = wl_container_of(l, launcher, destroy_listener);
189
190 free(launcher);
191}
192
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200193WL_EXPORT int
Emre Ucan0707b0e2018-01-25 14:36:13 +0100194wet_module_init(struct weston_compositor *compositor,
195 int *argc, char *argv[])
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200196{
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200197 struct test_launcher *launcher;
Emre Ucan0707b0e2018-01-25 14:36:13 +0100198 const struct ivi_layout_interface *iface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200199
Emre Ucan0707b0e2018-01-25 14:36:13 +0100200 iface = ivi_layout_get_api(compositor);
201
202 if (!iface) {
203 weston_log("fatal: cannot use ivi_layout_interface.\n");
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200204 return -1;
205 }
206
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200207 launcher = zalloc(sizeof *launcher);
208 if (!launcher)
209 return -1;
210
211 launcher->compositor = compositor;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000212 launcher->layout_interface = iface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200213
Pekka Paalanen2dcc79f2021-06-14 14:47:32 +0300214 if (!weston_compositor_add_destroy_listener_once(compositor,
215 &launcher->destroy_listener,
216 test_launcher_destroy)) {
217 free(launcher);
218 return -1;
219 }
220
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200221 if (wl_global_create(compositor->wl_display,
222 &weston_test_runner_interface, 1,
Pekka Paalanen2dcc79f2021-06-14 14:47:32 +0300223 launcher, bind_runner) == NULL) {
224 wl_list_remove(&launcher->destroy_listener.link);
225 free(launcher);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200226 return -1;
Pekka Paalanen2dcc79f2021-06-14 14:47:32 +0300227 }
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200228
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200229 return 0;
230}
231
232static void
233runner_assert_fail(const char *cond, const char *file, int line,
234 const char *func, struct test_context *ctx)
235{
236 weston_log("Assert failure in %s:%d, %s: '%s'\n",
237 file, line, func, cond);
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900238
239 assert(ctx->runner_resource);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200240 wl_resource_post_error(ctx->runner_resource,
241 WESTON_TEST_RUNNER_ERROR_TEST_FAILED,
242 "Assert failure in %s:%d, %s: '%s'\n",
243 file, line, func, cond);
244}
245
246#define runner_assert(cond) ({ \
247 bool b_ = (cond); \
248 if (!b_) \
249 runner_assert_fail(#cond, __FILE__, __LINE__, \
250 __func__, ctx); \
251 b_; \
252})
253
254#define runner_assert_or_return(cond) do { \
255 bool b_ = (cond); \
256 if (!b_) { \
257 runner_assert_fail(#cond, __FILE__, __LINE__, \
258 __func__, ctx); \
259 return; \
260 } \
261} while (0)
262
263
264/*************************** tests **********************************/
265
266/*
Pekka Paalanen7f840b72019-11-11 15:30:07 +0200267 * This is a IVI controller module requiring ivi-shell.so.
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200268 * This module is specially written to execute tests that target the
269 * ivi_layout API.
270 *
Pekka Paalanen7f840b72019-11-11 15:30:07 +0200271 * The test program containing the fixture setup and initiating the tests is
272 * test-ivi-layout-client (ivi-layout-test-client.c).
273 * That program uses the weston-test-runner framework to execute each TEST()
274 * in ivi-layout-test-client.c with a fresh connection to the single
275 * compositor instance.
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200276 *
Daniel Stone78a42112016-11-28 15:54:06 +0000277 * Each TEST() in ivi-layout-test-client.c will bind to weston_test_runner global
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200278 * interface. A TEST() will set up the client state, and issue
279 * weston_test_runner.run request to execute the compositor-side of the test.
280 *
281 * The compositor-side parts of the tests are in this file. They are specified
282 * by RUNNER_TEST() macro, where the name argument matches the name string
283 * passed to weston_test_runner.run.
284 *
285 * A RUNNER_TEST() function simply returns when it succeeds. If it fails,
286 * a fatal protocol error is sent to the client from runner_assert() or
Pekka Paalanen7f840b72019-11-11 15:30:07 +0200287 * runner_assert_or_return().
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200288 *
Daniel Stone78a42112016-11-28 15:54:06 +0000289 * A single TEST() in ivi-layout-test-client.c may use multiple RUNNER_TEST()s to
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200290 * achieve multiple test points over a client action sequence.
291 */
292
293RUNNER_TEST(surface_create_p1)
294{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000295 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200296 struct ivi_layout_surface *ivisurf[2];
297 uint32_t ivi_id;
298
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000299 ivisurf[0] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900300 runner_assert(ivisurf[0]);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200301
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000302 ivisurf[1] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(1));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900303 runner_assert(ivisurf[1]);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200304
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000305 ivi_id = lyt->get_id_of_surface(ivisurf[0]);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900306 runner_assert(ivi_id == IVI_TEST_SURFACE_ID(0));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200307
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000308 ivi_id = lyt->get_id_of_surface(ivisurf[1]);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900309 runner_assert(ivi_id == IVI_TEST_SURFACE_ID(1));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200310}
311
312RUNNER_TEST(surface_create_p2)
313{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000314 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200315 struct ivi_layout_surface *ivisurf;
316
317 /* the ivi_surface was destroyed by the client */
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000318 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900319 runner_assert(ivisurf == NULL);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200320}
321
322RUNNER_TEST(surface_visibility)
323{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000324 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200325 struct ivi_layout_surface *ivisurf;
326 int32_t ret;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200327 const struct ivi_layout_surface_properties *prop;
328
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000329 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900330 runner_assert(ivisurf);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200331
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000332 ret = lyt->surface_set_visibility(ivisurf, true);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900333 runner_assert(ret == IVI_SUCCEEDED);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200334
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000335 lyt->commit_changes();
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200336
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000337 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900338 runner_assert(prop->visibility == true);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200339}
340
341RUNNER_TEST(surface_opacity)
342{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000343 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200344 struct ivi_layout_surface *ivisurf;
345 int32_t ret;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200346 const struct ivi_layout_surface_properties *prop;
347
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000348 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900349 runner_assert(ivisurf);
350
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000351 prop = lyt->get_properties_of_surface(ivisurf);
352 runner_assert(prop->opacity == wl_fixed_from_double(1.0));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200353
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000354 ret = lyt->surface_set_opacity(ivisurf, wl_fixed_from_double(0.5));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900355 runner_assert(ret == IVI_SUCCEEDED);
356
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000357 runner_assert(prop->opacity == wl_fixed_from_double(1.0));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200358
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000359 lyt->commit_changes();
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200360
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900361 runner_assert(prop->opacity == wl_fixed_from_double(0.5));
362}
363
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900364RUNNER_TEST(surface_dimension)
365{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000366 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900367 struct ivi_layout_surface *ivisurf;
368 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900369
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000370 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900371 runner_assert(ivisurf != NULL);
372
Ucan, Emre \(ADITG/SW1\)c507f672016-03-04 12:50:28 +0000373 prop = lyt->get_properties_of_surface(ivisurf);
374 runner_assert_or_return(prop);
375 runner_assert(prop->dest_width == 1);
376 runner_assert(prop->dest_height == 1);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900377
378 runner_assert(IVI_SUCCEEDED ==
Ucan, Emre \(ADITG/SW1\)45d39422016-03-04 12:50:50 +0000379 lyt->surface_set_destination_rectangle(ivisurf, prop->dest_x,
380 prop->dest_y, 200, 300));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900381
Ucan, Emre \(ADITG/SW1\)c507f672016-03-04 12:50:28 +0000382 runner_assert(prop->dest_width == 1);
383 runner_assert(prop->dest_height == 1);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900384
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000385 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900386
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000387 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900388 runner_assert_or_return(prop);
389 runner_assert(prop->dest_width == 200);
390 runner_assert(prop->dest_height == 300);
391}
392
393RUNNER_TEST(surface_position)
394{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000395 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900396 struct ivi_layout_surface *ivisurf;
397 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900398
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000399 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900400 runner_assert(ivisurf != NULL);
401
Ucan, Emre \(ADITG/SW1\)b2ff2552016-03-04 12:50:20 +0000402 prop = lyt->get_properties_of_surface(ivisurf);
403 runner_assert_or_return(prop);
404 runner_assert(prop->dest_x == 0);
405 runner_assert(prop->dest_y == 0);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900406
Ucan, Emre \(ADITG/SW1\)161da402016-03-04 12:50:43 +0000407 runner_assert(lyt->surface_set_destination_rectangle(
408 ivisurf, 20, 30,
409 prop->dest_width, prop->dest_height) == IVI_SUCCEEDED);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900410
Ucan, Emre \(ADITG/SW1\)b2ff2552016-03-04 12:50:20 +0000411 runner_assert(prop->dest_x == 0);
412 runner_assert(prop->dest_y == 0);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900413
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000414 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900415
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000416 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900417 runner_assert_or_return(prop);
418 runner_assert(prop->dest_x == 20);
419 runner_assert(prop->dest_y == 30);
420}
421
422RUNNER_TEST(surface_destination_rectangle)
423{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000424 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900425 struct ivi_layout_surface *ivisurf;
426 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900427
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000428 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900429 runner_assert(ivisurf != NULL);
430
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000431 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900432 runner_assert_or_return(prop);
433 runner_assert(prop->dest_width == 1);
434 runner_assert(prop->dest_height == 1);
435 runner_assert(prop->dest_x == 0);
436 runner_assert(prop->dest_y == 0);
437
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000438 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900439 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
440
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000441 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900442 runner_assert_or_return(prop);
443 runner_assert(prop->dest_width == 1);
444 runner_assert(prop->dest_height == 1);
445 runner_assert(prop->dest_x == 0);
446 runner_assert(prop->dest_y == 0);
447
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000448 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900449
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000450 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900451 runner_assert_or_return(prop);
452 runner_assert(prop->dest_width == 200);
453 runner_assert(prop->dest_height == 300);
454 runner_assert(prop->dest_x == 20);
455 runner_assert(prop->dest_y == 30);
456}
457
458RUNNER_TEST(surface_source_rectangle)
459{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000460 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900461 struct ivi_layout_surface *ivisurf;
462 const struct ivi_layout_surface_properties *prop;
463
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000464 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900465 runner_assert(ivisurf != NULL);
466
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000467 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900468 runner_assert_or_return(prop);
469 runner_assert(prop->source_width == 0);
470 runner_assert(prop->source_height == 0);
471 runner_assert(prop->source_x == 0);
472 runner_assert(prop->source_y == 0);
473
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000474 runner_assert(lyt->surface_set_source_rectangle(
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900475 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
476
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000477 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900478 runner_assert_or_return(prop);
479 runner_assert(prop->source_width == 0);
480 runner_assert(prop->source_height == 0);
481 runner_assert(prop->source_x == 0);
482 runner_assert(prop->source_y == 0);
483
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000484 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900485
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000486 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900487 runner_assert_or_return(prop);
488 runner_assert(prop->source_width == 200);
489 runner_assert(prop->source_height == 300);
490 runner_assert(prop->source_x == 20);
491 runner_assert(prop->source_y == 30);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200492}
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900493
494RUNNER_TEST(surface_bad_opacity)
495{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000496 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900497 struct ivi_layout_surface *ivisurf;
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000498 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900499
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000500 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900501 runner_assert(ivisurf != NULL);
502
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000503 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900504 NULL, wl_fixed_from_double(0.3)) == IVI_FAILED);
505
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000506 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900507 ivisurf, wl_fixed_from_double(0.3)) == IVI_SUCCEEDED);
508
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000509 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900510 ivisurf, wl_fixed_from_double(-1)) == IVI_FAILED);
511
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000512 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900513
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000514 prop = lyt->get_properties_of_surface(ivisurf);
515 runner_assert(prop->opacity == wl_fixed_from_double(0.3));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900516
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000517 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900518 ivisurf, wl_fixed_from_double(1.1)) == IVI_FAILED);
519
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000520 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900521
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000522 runner_assert(prop->opacity == wl_fixed_from_double(0.3));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900523
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000524 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900525 NULL, wl_fixed_from_double(0.5)) == IVI_FAILED);
526
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000527 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900528}
529
Ucan, Emre (ADITG/SW1)37d25bb2016-06-07 09:40:21 +0000530RUNNER_TEST(surface_on_many_layer)
531{
532 const struct ivi_layout_interface *lyt = ctx->layout_interface;
533 struct ivi_layout_surface *ivisurf;
534 struct ivi_layout_layer *ivilayers[IVI_TEST_LAYER_COUNT] = {};
535 struct ivi_layout_layer **array;
536 int32_t length = 0;
537 uint32_t i;
538
539 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
540 runner_assert(ivisurf != NULL);
541
542 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++) {
543 ivilayers[i] = lyt->layer_create_with_dimension(
544 IVI_TEST_LAYER_ID(i), 200, 300);
545 runner_assert(lyt->layer_add_surface(
546 ivilayers[i], ivisurf) == IVI_SUCCEEDED);
547 }
548
549 lyt->commit_changes();
550
551 runner_assert(lyt->get_layers_under_surface(
552 ivisurf, &length, &array) == IVI_SUCCEEDED);
553 runner_assert(IVI_TEST_LAYER_COUNT == length);
554 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++)
555 runner_assert(array[i] == ivilayers[i]);
556
557 if (length > 0)
558 free(array);
559
560 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++)
561 lyt->layer_remove_surface(ivilayers[i], ivisurf);
562
563 array = NULL;
564
565 lyt->commit_changes();
566
567 runner_assert(lyt->get_layers_under_surface(
568 ivisurf, &length, &array) == IVI_SUCCEEDED);
569 runner_assert(length == 0 && array == NULL);
570
571 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++)
572 lyt->layer_destroy(ivilayers[i]);
573}
574
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900575RUNNER_TEST(ivi_layout_commit_changes)
576{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000577 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900578
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000579 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900580}
581
582RUNNER_TEST(commit_changes_after_visibility_set_surface_destroy)
583{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000584 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900585 struct ivi_layout_surface *ivisurf;
586
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000587 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900588 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000589 runner_assert(lyt->surface_set_visibility(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900590 ivisurf, true) == IVI_SUCCEEDED);
591}
592
593RUNNER_TEST(commit_changes_after_opacity_set_surface_destroy)
594{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000595 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900596 struct ivi_layout_surface *ivisurf;
597
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000598 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900599 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000600 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900601 ivisurf, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED);
602}
603
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900604RUNNER_TEST(commit_changes_after_source_rectangle_set_surface_destroy)
605{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000606 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900607 struct ivi_layout_surface *ivisurf;
608
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000609 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900610 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000611 runner_assert(lyt->surface_set_source_rectangle(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900612 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
613}
614
615RUNNER_TEST(commit_changes_after_destination_rectangle_set_surface_destroy)
616{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000617 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900618 struct ivi_layout_surface *ivisurf;
619
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000620 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900621 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000622 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900623 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
624}
625
626RUNNER_TEST(get_surface_after_destroy_surface)
627{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000628 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900629 struct ivi_layout_surface *ivisurf;
630
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000631 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900632 runner_assert(ivisurf == NULL);
633}
634
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900635RUNNER_TEST(layer_render_order)
636{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000637 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900638 struct ivi_layout_layer *ivilayer;
639 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
640 struct ivi_layout_surface **array;
641 int32_t length = 0;
642 uint32_t i;
643
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000644 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900645
646 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000647 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900648
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000649 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900650 ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
651
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000652 lyt->commit_changes();
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900653
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000654 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900655 ivilayer, &length, &array) == IVI_SUCCEEDED);
656 runner_assert(IVI_TEST_SURFACE_COUNT == length);
657 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
658 runner_assert(array[i] == ivisurfs[i]);
659
660 if (length > 0)
661 free(array);
662
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000663 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900664 ivilayer, NULL, 0) == IVI_SUCCEEDED);
665
666 array = NULL;
667
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000668 lyt->commit_changes();
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900669
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000670 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900671 ivilayer, &length, &array) == IVI_SUCCEEDED);
672 runner_assert(length == 0 && array == NULL);
673
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000674 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900675}
676
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900677RUNNER_TEST(test_layer_render_order_destroy_one_surface_p1)
678{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000679 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900680 struct ivi_layout_layer *ivilayer;
681 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
682 struct ivi_layout_surface **array;
683 int32_t length = 0;
684 int32_t i;
685
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000686 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900687
688 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000689 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900690
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000691 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900692 ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
693
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000694 lyt->commit_changes();
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900695
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000696 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900697 ivilayer, &length, &array) == IVI_SUCCEEDED);
698 runner_assert(IVI_TEST_SURFACE_COUNT == length);
699 for (i = 0; i < length; i++)
700 runner_assert(array[i] == ivisurfs[i]);
701
702 if (length > 0)
703 free(array);
704}
705
706RUNNER_TEST(test_layer_render_order_destroy_one_surface_p2)
707{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000708 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900709 struct ivi_layout_layer *ivilayer;
710 struct ivi_layout_surface *ivisurfs[2] = {};
711 struct ivi_layout_surface **array;
712 int32_t length = 0;
713 int32_t i;
714
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000715 ivilayer = lyt->get_layer_from_id(IVI_TEST_LAYER_ID(0));
716 ivisurfs[0] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
717 ivisurfs[1] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(2));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900718
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000719 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900720 ivilayer, &length, &array) == IVI_SUCCEEDED);
721 runner_assert(2 == length);
722 for (i = 0; i < length; i++)
723 runner_assert(array[i] == ivisurfs[i]);
724
725 if (length > 0)
726 free(array);
727
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000728 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900729}
730
731RUNNER_TEST(layer_bad_render_order)
732{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000733 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900734 struct ivi_layout_layer *ivilayer;
735 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
736 struct ivi_layout_surface **array = NULL;
737 int32_t length = 0;
738 uint32_t i;
739
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000740 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900741
742 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000743 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900744
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000745 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900746 NULL, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_FAILED);
747
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000748 lyt->commit_changes();
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900749
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000750 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900751 NULL, &length, &array) == IVI_FAILED);
752 runner_assert(length == 0 && array == NULL);
753
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000754 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900755 ivilayer, NULL, &array) == IVI_FAILED);
756 runner_assert(array == NULL);
757
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000758 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900759 ivilayer, &length, NULL) == IVI_FAILED);
760 runner_assert(length == 0);
761
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000762 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900763}
764
Ucan, Emre (ADITG/SW1)5d6aa9b2017-01-18 15:25:35 +0000765RUNNER_TEST(layer_add_surfaces)
766{
767 const struct ivi_layout_interface *lyt = ctx->layout_interface;
768 struct ivi_layout_layer *ivilayer;
769 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
770 struct ivi_layout_surface **array;
771 int32_t length = 0;
772 uint32_t i;
773
774 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
775
776 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++) {
777 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
778 runner_assert(lyt->layer_add_surface(
779 ivilayer, ivisurfs[i]) == IVI_SUCCEEDED);
780 }
781
782 lyt->commit_changes();
783
784 runner_assert(lyt->get_surfaces_on_layer(
785 ivilayer, &length, &array) == IVI_SUCCEEDED);
786 runner_assert(IVI_TEST_SURFACE_COUNT == length);
787 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
788 runner_assert(array[i] == ivisurfs[i]);
789
790 if (length > 0)
791 free(array);
792
793 runner_assert(lyt->layer_set_render_order(
794 ivilayer, NULL, 0) == IVI_SUCCEEDED);
795
796 for (i = IVI_TEST_SURFACE_COUNT; i-- > 0;)
797 runner_assert(lyt->layer_add_surface(
798 ivilayer, ivisurfs[i]) == IVI_SUCCEEDED);
799
800 lyt->commit_changes();
801
802 runner_assert(lyt->get_surfaces_on_layer(
803 ivilayer, &length, &array) == IVI_SUCCEEDED);
804 runner_assert(IVI_TEST_SURFACE_COUNT == length);
805 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
806 runner_assert(array[i] == ivisurfs[IVI_TEST_SURFACE_COUNT - (i + 1)]);
807
808 if (length > 0)
809 free(array);
810
811 lyt->layer_destroy(ivilayer);
812}
813
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900814RUNNER_TEST(commit_changes_after_render_order_set_surface_destroy)
815{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000816 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900817 struct ivi_layout_layer *ivilayer;
818 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
819 int i;
820
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000821 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900822
823 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000824 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900825
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000826 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900827 ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
828}
829
830RUNNER_TEST(cleanup_layer)
831{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000832 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900833 struct ivi_layout_layer *ivilayer;
834
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000835 ivilayer = lyt->get_layer_from_id(IVI_TEST_LAYER_ID(0));
836 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900837}
838
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900839static void
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000840test_surface_properties_changed_notification_callback(struct wl_listener *listener, void *data)
841
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900842{
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000843 struct test_context *ctx =
844 container_of(listener, struct test_context,
845 surface_property_changed);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000846 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000847 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900848
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000849 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900850
851 ctx->user_flags = 1;
852}
853
854RUNNER_TEST(surface_properties_changed_notification)
855{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000856 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900857 const uint32_t id_surface = IVI_TEST_SURFACE_ID(0);
858 struct ivi_layout_surface *ivisurf;
859
860 ctx->user_flags = 0;
861
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000862 ivisurf = lyt->get_surface_from_id(id_surface);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900863 runner_assert(ivisurf != NULL);
864
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000865 ctx->surface_property_changed.notify = test_surface_properties_changed_notification_callback;
866
867 runner_assert(lyt->surface_add_listener(
868 ivisurf, &ctx->surface_property_changed) == IVI_SUCCEEDED);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900869
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000870 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900871
872 runner_assert(ctx->user_flags == 0);
873
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000874 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900875 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
876
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000877 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900878
879 runner_assert(ctx->user_flags == 1);
880
881 ctx->user_flags = 0;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000882 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900883 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
884
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000885 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900886
887 runner_assert(ctx->user_flags == 0);
888
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000889 // remove surface property changed listener.
890 wl_list_remove(&ctx->surface_property_changed.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900891 ctx->user_flags = 0;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000892 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900893 ivisurf, 40, 50, 400, 500) == IVI_SUCCEEDED);
894
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000895 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900896
897 runner_assert(ctx->user_flags == 0);
898}
899
900static void
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000901test_surface_configure_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900902{
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000903 struct test_context *ctx =
904 container_of(listener, struct test_context,
905 surface_configured);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000906 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000907 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900908
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000909 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900910
911 ctx->user_flags = 1;
912}
913
914RUNNER_TEST(surface_configure_notification_p1)
915{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000916 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900917
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000918 ctx->surface_configured.notify = test_surface_configure_notification_callback;
919 runner_assert(IVI_SUCCEEDED == lyt->add_listener_configure_surface(&ctx->surface_configured));
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000920 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900921
922 ctx->user_flags = 0;
923}
924
925RUNNER_TEST(surface_configure_notification_p2)
926{
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900927 runner_assert(ctx->user_flags == 1);
928
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000929 // remove surface configured listener.
930 wl_list_remove(&ctx->surface_configured.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900931 ctx->user_flags = 0;
932}
933
934RUNNER_TEST(surface_configure_notification_p3)
935{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000936 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900937
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000938 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900939 runner_assert(ctx->user_flags == 0);
940}
941
942static void
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000943test_surface_create_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900944{
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000945 struct test_context *ctx =
946 container_of(listener, struct test_context,
947 surface_created);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000948 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000949 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900950
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000951 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900952
953 ctx->user_flags = 1;
954}
955
956RUNNER_TEST(surface_create_notification_p1)
957{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000958 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900959
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000960 ctx->surface_created.notify = test_surface_create_notification_callback;
961 runner_assert(lyt->add_listener_create_surface(
962 &ctx->surface_created) == IVI_SUCCEEDED);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900963
964 ctx->user_flags = 0;
965}
966
967RUNNER_TEST(surface_create_notification_p2)
968{
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900969 runner_assert(ctx->user_flags == 1);
970
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000971 // remove surface created listener.
972 wl_list_remove(&ctx->surface_created.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900973 ctx->user_flags = 0;
974}
975
976RUNNER_TEST(surface_create_notification_p3)
977{
978 runner_assert(ctx->user_flags == 0);
979}
980
981static void
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +0000982test_surface_remove_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900983{
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +0000984 struct test_context *ctx =
985 container_of(listener, struct test_context,
986 surface_removed);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000987 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +0000988 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900989
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000990 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900991
992 ctx->user_flags = 1;
993}
994
995RUNNER_TEST(surface_remove_notification_p1)
996{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000997 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900998
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +0000999 ctx->surface_removed.notify = test_surface_remove_notification_callback;
1000 runner_assert(lyt->add_listener_remove_surface(&ctx->surface_removed)
1001 == IVI_SUCCEEDED);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001002
1003 ctx->user_flags = 0;
1004}
1005
1006RUNNER_TEST(surface_remove_notification_p2)
1007{
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001008 runner_assert(ctx->user_flags == 1);
1009
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001010 // remove surface removed listener.
1011 wl_list_remove(&ctx->surface_removed.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001012 ctx->user_flags = 0;
1013}
1014
1015RUNNER_TEST(surface_remove_notification_p3)
1016{
1017 runner_assert(ctx->user_flags == 0);
1018}
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001019
1020static void
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +00001021test_surface_bad_properties_changed_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001022{
1023}
1024
1025RUNNER_TEST(surface_bad_properties_changed_notification)
1026{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001027 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001028 struct ivi_layout_surface *ivisurf;
1029
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001030 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001031 runner_assert(ivisurf != NULL);
1032
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +00001033 ctx->surface_property_changed.notify = test_surface_bad_properties_changed_notification_callback;
1034
1035 runner_assert(lyt->surface_add_listener(
1036 NULL, &ctx->surface_property_changed) == IVI_FAILED);
1037 runner_assert(lyt->surface_add_listener(
1038 ivisurf, NULL) == IVI_FAILED);
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001039}