blob: 4799919cd54f16769c6197563364e9066d4eea69 [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>
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020036
Pekka Paalanen3d5d9472019-03-28 16:28:47 +020037#include <libweston/libweston.h>
Pekka Paalanen58f98c92016-06-03 16:45:21 +030038#include "compositor/weston.h"
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020039#include "weston-test-server-protocol.h"
40#include "ivi-test.h"
Jon Cruz4678bab2015-06-15 15:37:07 -070041#include "ivi-shell/ivi-layout-export.h"
Jon Cruz867d50e2015-06-15 15:37:10 -070042#include "shared/helpers.h"
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020043
44struct test_context;
45
46struct runner_test {
47 const char *name;
48 void (*run)(struct test_context *);
49} __attribute__ ((aligned (32)));
50
51#define RUNNER_TEST(name) \
52 static void runner_func_##name(struct test_context *); \
53 \
54 const struct runner_test runner_test_##name \
55 __attribute__ ((section ("test_section"))) = \
56 { \
57 #name, runner_func_##name \
58 }; \
59 \
60 static void runner_func_##name(struct test_context *ctx)
61
62extern const struct runner_test __start_test_section;
63extern const struct runner_test __stop_test_section;
64
65static const struct runner_test *
66find_runner_test(const char *name)
67{
68 const struct runner_test *t;
69
70 for (t = &__start_test_section; t < &__stop_test_section; t++) {
71 if (strcmp(t->name, name) == 0)
72 return t;
73 }
74
75 return NULL;
76}
77
78struct test_launcher {
79 struct weston_compositor *compositor;
80 char exe[2048];
81 struct weston_process process;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +000082 const struct ivi_layout_interface *layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +020083};
84
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090085struct test_context {
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +000086 const struct ivi_layout_interface *layout_interface;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090087 struct wl_resource *runner_resource;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +090088 uint32_t user_flags;
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +000089
90 struct wl_listener surface_property_changed;
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +000091 struct wl_listener surface_created;
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +000092 struct wl_listener surface_removed;
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +000093 struct wl_listener surface_configured;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +090094};
95
96static struct test_context static_context;
97
98static void
99destroy_runner(struct wl_resource *resource)
100{
101 assert(static_context.runner_resource == NULL ||
102 static_context.runner_resource == resource);
103
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000104 static_context.layout_interface = NULL;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900105 static_context.runner_resource = NULL;
106}
107
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200108static void
109runner_destroy_handler(struct wl_client *client, struct wl_resource *resource)
110{
111 wl_resource_destroy(resource);
112}
113
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200114static void
115runner_run_handler(struct wl_client *client, struct wl_resource *resource,
116 const char *test_name)
117{
118 struct test_launcher *launcher;
119 const struct runner_test *t;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900120
121 assert(static_context.runner_resource == NULL ||
122 static_context.runner_resource == resource);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200123
124 launcher = wl_resource_get_user_data(resource);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000125 static_context.layout_interface = launcher->layout_interface;
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900126 static_context.runner_resource = resource;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200127
128 t = find_runner_test(test_name);
129 if (!t) {
130 weston_log("Error: runner test \"%s\" not found.\n",
131 test_name);
132 wl_resource_post_error(resource,
133 WESTON_TEST_RUNNER_ERROR_UNKNOWN_TEST,
134 "weston_test_runner: unknown: '%s'",
135 test_name);
136 return;
137 }
138
139 weston_log("weston_test_runner.run(\"%s\")\n", test_name);
140
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900141 t->run(&static_context);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200142
143 weston_test_runner_send_finished(resource);
144}
145
146static const struct weston_test_runner_interface runner_implementation = {
147 runner_destroy_handler,
148 runner_run_handler
149};
150
151static void
152bind_runner(struct wl_client *client, void *data,
153 uint32_t version, uint32_t id)
154{
155 struct test_launcher *launcher = data;
156 struct wl_resource *resource;
157
158 resource = wl_resource_create(client, &weston_test_runner_interface,
159 1, id);
160 if (!resource) {
161 wl_client_post_no_memory(client);
162 return;
163 }
164
165 wl_resource_set_implementation(resource, &runner_implementation,
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900166 launcher, destroy_runner);
167
168 if (static_context.runner_resource != NULL) {
169 weston_log("test FATAL: "
170 "attempting to run several tests in parallel.\n");
171 wl_resource_post_error(resource,
172 WESTON_TEST_RUNNER_ERROR_TEST_FAILED,
173 "attempt to run parallel tests");
174 }
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200175}
176
177static void
178test_client_sigchld(struct weston_process *process, int status)
179{
180 struct test_launcher *launcher =
181 container_of(process, struct test_launcher, process);
182 struct weston_compositor *c = launcher->compositor;
183
Pekka Paalanenbe61a1f2019-03-14 16:56:27 +0200184 /* Chain up from weston-test-runner's exit code so that ninja
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200185 * knows the exit status and can report e.g. skipped tests. */
186 if (WIFEXITED(status))
187 weston_compositor_exit_with_code(c, WEXITSTATUS(status));
188 else
189 weston_compositor_exit_with_code(c, EXIT_FAILURE);
190}
191
192static void
193idle_launch_client(void *data)
194{
195 struct test_launcher *launcher = data;
196 pid_t pid;
197 sigset_t allsigs;
198
199 pid = fork();
200 if (pid == -1) {
201 weston_log("fatal: failed to fork '%s': %m\n", launcher->exe);
202 weston_compositor_exit_with_code(launcher->compositor,
203 EXIT_FAILURE);
204 return;
205 }
206
207 if (pid == 0) {
208 sigfillset(&allsigs);
209 sigprocmask(SIG_UNBLOCK, &allsigs, NULL);
210 execl(launcher->exe, launcher->exe, NULL);
211 weston_log("compositor: executing '%s' failed: %m\n",
212 launcher->exe);
213 _exit(EXIT_FAILURE);
214 }
215
216 launcher->process.pid = pid;
217 launcher->process.cleanup = test_client_sigchld;
218 weston_watch_process(&launcher->process);
219}
220
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200221WL_EXPORT int
Emre Ucan0707b0e2018-01-25 14:36:13 +0100222wet_module_init(struct weston_compositor *compositor,
223 int *argc, char *argv[])
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200224{
225 struct wl_event_loop *loop;
226 struct test_launcher *launcher;
Emre Ucan0707b0e2018-01-25 14:36:13 +0100227 const struct ivi_layout_interface *iface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200228
Emre Ucan0707b0e2018-01-25 14:36:13 +0100229 iface = ivi_layout_get_api(compositor);
230
231 if (!iface) {
232 weston_log("fatal: cannot use ivi_layout_interface.\n");
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200233 return -1;
234 }
235
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200236 launcher = zalloc(sizeof *launcher);
237 if (!launcher)
238 return -1;
239
Daniel Stone78a42112016-11-28 15:54:06 +0000240 if (weston_module_path_from_env("ivi-layout-test-client.ivi",
241 launcher->exe,
Daniel Stonee03c1112016-11-24 20:45:45 +0000242 sizeof launcher->exe) == 0) {
243 weston_log("test setup failure: WESTON_MODULE_MAP not set\n");
244 return -1;
245 }
246
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200247 launcher->compositor = compositor;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000248 launcher->layout_interface = iface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200249
250 if (wl_global_create(compositor->wl_display,
251 &weston_test_runner_interface, 1,
252 launcher, bind_runner) == NULL)
253 return -1;
254
255 loop = wl_display_get_event_loop(compositor->wl_display);
256 wl_event_loop_add_idle(loop, idle_launch_client, launcher);
257
258 return 0;
259}
260
261static void
262runner_assert_fail(const char *cond, const char *file, int line,
263 const char *func, struct test_context *ctx)
264{
265 weston_log("Assert failure in %s:%d, %s: '%s'\n",
266 file, line, func, cond);
Nobuhiko Tanibataa10352e2015-06-22 15:35:49 +0900267
268 assert(ctx->runner_resource);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200269 wl_resource_post_error(ctx->runner_resource,
270 WESTON_TEST_RUNNER_ERROR_TEST_FAILED,
271 "Assert failure in %s:%d, %s: '%s'\n",
272 file, line, func, cond);
273}
274
275#define runner_assert(cond) ({ \
276 bool b_ = (cond); \
277 if (!b_) \
278 runner_assert_fail(#cond, __FILE__, __LINE__, \
279 __func__, ctx); \
280 b_; \
281})
282
283#define runner_assert_or_return(cond) do { \
284 bool b_ = (cond); \
285 if (!b_) { \
286 runner_assert_fail(#cond, __FILE__, __LINE__, \
287 __func__, ctx); \
288 return; \
289 } \
290} while (0)
291
292
293/*************************** tests **********************************/
294
295/*
296 * This is a controller module: a plugin to ivi-shell.so, i.e. a sub-plugin.
297 * This module is specially written to execute tests that target the
298 * ivi_layout API.
299 *
Pekka Paalanenbe61a1f2019-03-14 16:56:27 +0200300 * This module is listed in meson.build which handles
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200301 * this module specially by loading it in ivi-shell.
302 *
303 * Once Weston init completes, this module launches one test program:
Daniel Stone78a42112016-11-28 15:54:06 +0000304 * ivi-layout-test-client.ivi (ivi-layout-test-client.c).
305 * That program uses the weston-test-runner
306 * framework to fork and exec each TEST() in ivi-layout-test-client.c with a fresh
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200307 * connection to the single compositor instance.
308 *
Daniel Stone78a42112016-11-28 15:54:06 +0000309 * Each TEST() in ivi-layout-test-client.c will bind to weston_test_runner global
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200310 * interface. A TEST() will set up the client state, and issue
311 * weston_test_runner.run request to execute the compositor-side of the test.
312 *
313 * The compositor-side parts of the tests are in this file. They are specified
314 * by RUNNER_TEST() macro, where the name argument matches the name string
315 * passed to weston_test_runner.run.
316 *
317 * A RUNNER_TEST() function simply returns when it succeeds. If it fails,
318 * a fatal protocol error is sent to the client from runner_assert() or
319 * runner_assert_or_return(). This module catches the test program exit
320 * code and passes it out of Weston to the test harness.
321 *
Daniel Stone78a42112016-11-28 15:54:06 +0000322 * A single TEST() in ivi-layout-test-client.c may use multiple RUNNER_TEST()s to
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200323 * achieve multiple test points over a client action sequence.
324 */
325
326RUNNER_TEST(surface_create_p1)
327{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000328 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200329 struct ivi_layout_surface *ivisurf[2];
330 uint32_t ivi_id;
331
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000332 ivisurf[0] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900333 runner_assert(ivisurf[0]);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200334
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000335 ivisurf[1] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(1));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900336 runner_assert(ivisurf[1]);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200337
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000338 ivi_id = lyt->get_id_of_surface(ivisurf[0]);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900339 runner_assert(ivi_id == IVI_TEST_SURFACE_ID(0));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200340
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000341 ivi_id = lyt->get_id_of_surface(ivisurf[1]);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900342 runner_assert(ivi_id == IVI_TEST_SURFACE_ID(1));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200343}
344
345RUNNER_TEST(surface_create_p2)
346{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000347 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200348 struct ivi_layout_surface *ivisurf;
349
350 /* the ivi_surface was destroyed by the client */
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000351 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900352 runner_assert(ivisurf == NULL);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200353}
354
355RUNNER_TEST(surface_visibility)
356{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000357 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200358 struct ivi_layout_surface *ivisurf;
359 int32_t ret;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200360 const struct ivi_layout_surface_properties *prop;
361
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000362 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900363 runner_assert(ivisurf);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200364
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000365 ret = lyt->surface_set_visibility(ivisurf, true);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900366 runner_assert(ret == IVI_SUCCEEDED);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200367
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000368 lyt->commit_changes();
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200369
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000370 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900371 runner_assert(prop->visibility == true);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200372}
373
374RUNNER_TEST(surface_opacity)
375{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000376 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200377 struct ivi_layout_surface *ivisurf;
378 int32_t ret;
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200379 const struct ivi_layout_surface_properties *prop;
380
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000381 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900382 runner_assert(ivisurf);
383
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000384 prop = lyt->get_properties_of_surface(ivisurf);
385 runner_assert(prop->opacity == wl_fixed_from_double(1.0));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200386
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000387 ret = lyt->surface_set_opacity(ivisurf, wl_fixed_from_double(0.5));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900388 runner_assert(ret == IVI_SUCCEEDED);
389
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000390 runner_assert(prop->opacity == wl_fixed_from_double(1.0));
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200391
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000392 lyt->commit_changes();
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200393
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900394 runner_assert(prop->opacity == wl_fixed_from_double(0.5));
395}
396
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900397RUNNER_TEST(surface_dimension)
398{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000399 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900400 struct ivi_layout_surface *ivisurf;
401 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900402
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000403 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900404 runner_assert(ivisurf != NULL);
405
Ucan, Emre \(ADITG/SW1\)c507f672016-03-04 12:50:28 +0000406 prop = lyt->get_properties_of_surface(ivisurf);
407 runner_assert_or_return(prop);
408 runner_assert(prop->dest_width == 1);
409 runner_assert(prop->dest_height == 1);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900410
411 runner_assert(IVI_SUCCEEDED ==
Ucan, Emre \(ADITG/SW1\)45d39422016-03-04 12:50:50 +0000412 lyt->surface_set_destination_rectangle(ivisurf, prop->dest_x,
413 prop->dest_y, 200, 300));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900414
Ucan, Emre \(ADITG/SW1\)c507f672016-03-04 12:50:28 +0000415 runner_assert(prop->dest_width == 1);
416 runner_assert(prop->dest_height == 1);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900417
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000418 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900419
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000420 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900421 runner_assert_or_return(prop);
422 runner_assert(prop->dest_width == 200);
423 runner_assert(prop->dest_height == 300);
424}
425
426RUNNER_TEST(surface_position)
427{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000428 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900429 struct ivi_layout_surface *ivisurf;
430 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900431
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000432 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900433 runner_assert(ivisurf != NULL);
434
Ucan, Emre \(ADITG/SW1\)b2ff2552016-03-04 12:50:20 +0000435 prop = lyt->get_properties_of_surface(ivisurf);
436 runner_assert_or_return(prop);
437 runner_assert(prop->dest_x == 0);
438 runner_assert(prop->dest_y == 0);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900439
Ucan, Emre \(ADITG/SW1\)161da402016-03-04 12:50:43 +0000440 runner_assert(lyt->surface_set_destination_rectangle(
441 ivisurf, 20, 30,
442 prop->dest_width, prop->dest_height) == IVI_SUCCEEDED);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900443
Ucan, Emre \(ADITG/SW1\)b2ff2552016-03-04 12:50:20 +0000444 runner_assert(prop->dest_x == 0);
445 runner_assert(prop->dest_y == 0);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900446
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000447 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900448
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000449 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900450 runner_assert_or_return(prop);
451 runner_assert(prop->dest_x == 20);
452 runner_assert(prop->dest_y == 30);
453}
454
455RUNNER_TEST(surface_destination_rectangle)
456{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000457 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900458 struct ivi_layout_surface *ivisurf;
459 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900460
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000461 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900462 runner_assert(ivisurf != NULL);
463
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000464 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900465 runner_assert_or_return(prop);
466 runner_assert(prop->dest_width == 1);
467 runner_assert(prop->dest_height == 1);
468 runner_assert(prop->dest_x == 0);
469 runner_assert(prop->dest_y == 0);
470
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000471 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900472 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
473
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000474 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900475 runner_assert_or_return(prop);
476 runner_assert(prop->dest_width == 1);
477 runner_assert(prop->dest_height == 1);
478 runner_assert(prop->dest_x == 0);
479 runner_assert(prop->dest_y == 0);
480
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000481 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900482
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000483 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900484 runner_assert_or_return(prop);
485 runner_assert(prop->dest_width == 200);
486 runner_assert(prop->dest_height == 300);
487 runner_assert(prop->dest_x == 20);
488 runner_assert(prop->dest_y == 30);
489}
490
491RUNNER_TEST(surface_source_rectangle)
492{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000493 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900494 struct ivi_layout_surface *ivisurf;
495 const struct ivi_layout_surface_properties *prop;
496
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000497 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900498 runner_assert(ivisurf != NULL);
499
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000500 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900501 runner_assert_or_return(prop);
502 runner_assert(prop->source_width == 0);
503 runner_assert(prop->source_height == 0);
504 runner_assert(prop->source_x == 0);
505 runner_assert(prop->source_y == 0);
506
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000507 runner_assert(lyt->surface_set_source_rectangle(
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900508 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
509
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000510 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900511 runner_assert_or_return(prop);
512 runner_assert(prop->source_width == 0);
513 runner_assert(prop->source_height == 0);
514 runner_assert(prop->source_x == 0);
515 runner_assert(prop->source_y == 0);
516
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000517 lyt->commit_changes();
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900518
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000519 prop = lyt->get_properties_of_surface(ivisurf);
Nobuhiko Tanibata23d95822015-06-22 15:33:17 +0900520 runner_assert_or_return(prop);
521 runner_assert(prop->source_width == 200);
522 runner_assert(prop->source_height == 300);
523 runner_assert(prop->source_x == 20);
524 runner_assert(prop->source_y == 30);
Pekka Paalanenf5b74f72015-03-25 12:50:31 +0200525}
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900526
527RUNNER_TEST(surface_bad_opacity)
528{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000529 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900530 struct ivi_layout_surface *ivisurf;
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000531 const struct ivi_layout_surface_properties *prop;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900532
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000533 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900534 runner_assert(ivisurf != NULL);
535
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000536 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900537 NULL, wl_fixed_from_double(0.3)) == IVI_FAILED);
538
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000539 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900540 ivisurf, wl_fixed_from_double(0.3)) == IVI_SUCCEEDED);
541
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000542 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900543 ivisurf, wl_fixed_from_double(-1)) == IVI_FAILED);
544
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000545 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900546
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000547 prop = lyt->get_properties_of_surface(ivisurf);
548 runner_assert(prop->opacity == wl_fixed_from_double(0.3));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900549
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000550 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900551 ivisurf, wl_fixed_from_double(1.1)) == IVI_FAILED);
552
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000553 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900554
Ucan, Emre \(ADITG/SW1\)995e6fb2016-03-04 12:50:12 +0000555 runner_assert(prop->opacity == wl_fixed_from_double(0.3));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900556
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000557 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900558 NULL, wl_fixed_from_double(0.5)) == IVI_FAILED);
559
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000560 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900561}
562
Ucan, Emre (ADITG/SW1)37d25bb2016-06-07 09:40:21 +0000563RUNNER_TEST(surface_on_many_layer)
564{
565 const struct ivi_layout_interface *lyt = ctx->layout_interface;
566 struct ivi_layout_surface *ivisurf;
567 struct ivi_layout_layer *ivilayers[IVI_TEST_LAYER_COUNT] = {};
568 struct ivi_layout_layer **array;
569 int32_t length = 0;
570 uint32_t i;
571
572 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
573 runner_assert(ivisurf != NULL);
574
575 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++) {
576 ivilayers[i] = lyt->layer_create_with_dimension(
577 IVI_TEST_LAYER_ID(i), 200, 300);
578 runner_assert(lyt->layer_add_surface(
579 ivilayers[i], ivisurf) == IVI_SUCCEEDED);
580 }
581
582 lyt->commit_changes();
583
584 runner_assert(lyt->get_layers_under_surface(
585 ivisurf, &length, &array) == IVI_SUCCEEDED);
586 runner_assert(IVI_TEST_LAYER_COUNT == length);
587 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++)
588 runner_assert(array[i] == ivilayers[i]);
589
590 if (length > 0)
591 free(array);
592
593 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++)
594 lyt->layer_remove_surface(ivilayers[i], ivisurf);
595
596 array = NULL;
597
598 lyt->commit_changes();
599
600 runner_assert(lyt->get_layers_under_surface(
601 ivisurf, &length, &array) == IVI_SUCCEEDED);
602 runner_assert(length == 0 && array == NULL);
603
604 for (i = 0; i < IVI_TEST_LAYER_COUNT; i++)
605 lyt->layer_destroy(ivilayers[i]);
606}
607
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900608RUNNER_TEST(ivi_layout_commit_changes)
609{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000610 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900611
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000612 lyt->commit_changes();
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900613}
614
615RUNNER_TEST(commit_changes_after_visibility_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_visibility(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900623 ivisurf, true) == IVI_SUCCEEDED);
624}
625
626RUNNER_TEST(commit_changes_after_opacity_set_surface_destroy)
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);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000633 runner_assert(lyt->surface_set_opacity(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900634 ivisurf, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED);
635}
636
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900637RUNNER_TEST(commit_changes_after_source_rectangle_set_surface_destroy)
638{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000639 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900640 struct ivi_layout_surface *ivisurf;
641
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000642 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900643 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000644 runner_assert(lyt->surface_set_source_rectangle(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900645 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
646}
647
648RUNNER_TEST(commit_changes_after_destination_rectangle_set_surface_destroy)
649{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000650 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900651 struct ivi_layout_surface *ivisurf;
652
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000653 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900654 runner_assert(ivisurf != NULL);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000655 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900656 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
657}
658
659RUNNER_TEST(get_surface_after_destroy_surface)
660{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000661 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900662 struct ivi_layout_surface *ivisurf;
663
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000664 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibatac74bafa2015-06-22 15:33:26 +0900665 runner_assert(ivisurf == NULL);
666}
667
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900668RUNNER_TEST(layer_render_order)
669{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000670 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900671 struct ivi_layout_layer *ivilayer;
672 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
673 struct ivi_layout_surface **array;
674 int32_t length = 0;
675 uint32_t i;
676
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000677 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900678
679 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000680 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900681
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000682 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900683 ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
684
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000685 lyt->commit_changes();
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900686
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000687 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900688 ivilayer, &length, &array) == IVI_SUCCEEDED);
689 runner_assert(IVI_TEST_SURFACE_COUNT == length);
690 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
691 runner_assert(array[i] == ivisurfs[i]);
692
693 if (length > 0)
694 free(array);
695
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000696 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900697 ivilayer, NULL, 0) == IVI_SUCCEEDED);
698
699 array = NULL;
700
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000701 lyt->commit_changes();
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900702
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000703 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900704 ivilayer, &length, &array) == IVI_SUCCEEDED);
705 runner_assert(length == 0 && array == NULL);
706
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000707 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibatad3643932015-06-22 15:34:09 +0900708}
709
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900710RUNNER_TEST(test_layer_render_order_destroy_one_surface_p1)
711{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000712 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900713 struct ivi_layout_layer *ivilayer;
714 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
715 struct ivi_layout_surface **array;
716 int32_t length = 0;
717 int32_t i;
718
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000719 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900720
721 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000722 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900723
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000724 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900725 ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
726
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000727 lyt->commit_changes();
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900728
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000729 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900730 ivilayer, &length, &array) == IVI_SUCCEEDED);
731 runner_assert(IVI_TEST_SURFACE_COUNT == length);
732 for (i = 0; i < length; i++)
733 runner_assert(array[i] == ivisurfs[i]);
734
735 if (length > 0)
736 free(array);
737}
738
739RUNNER_TEST(test_layer_render_order_destroy_one_surface_p2)
740{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000741 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900742 struct ivi_layout_layer *ivilayer;
743 struct ivi_layout_surface *ivisurfs[2] = {};
744 struct ivi_layout_surface **array;
745 int32_t length = 0;
746 int32_t i;
747
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000748 ivilayer = lyt->get_layer_from_id(IVI_TEST_LAYER_ID(0));
749 ivisurfs[0] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
750 ivisurfs[1] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(2));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900751
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000752 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900753 ivilayer, &length, &array) == IVI_SUCCEEDED);
754 runner_assert(2 == length);
755 for (i = 0; i < length; i++)
756 runner_assert(array[i] == ivisurfs[i]);
757
758 if (length > 0)
759 free(array);
760
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000761 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900762}
763
764RUNNER_TEST(layer_bad_render_order)
765{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000766 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900767 struct ivi_layout_layer *ivilayer;
768 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
769 struct ivi_layout_surface **array = NULL;
770 int32_t length = 0;
771 uint32_t i;
772
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000773 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900774
775 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000776 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900777
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000778 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900779 NULL, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_FAILED);
780
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000781 lyt->commit_changes();
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900782
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000783 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900784 NULL, &length, &array) == IVI_FAILED);
785 runner_assert(length == 0 && array == NULL);
786
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000787 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900788 ivilayer, NULL, &array) == IVI_FAILED);
789 runner_assert(array == NULL);
790
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000791 runner_assert(lyt->get_surfaces_on_layer(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900792 ivilayer, &length, NULL) == IVI_FAILED);
793 runner_assert(length == 0);
794
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000795 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900796}
797
Ucan, Emre (ADITG/SW1)5d6aa9b2017-01-18 15:25:35 +0000798RUNNER_TEST(layer_add_surfaces)
799{
800 const struct ivi_layout_interface *lyt = ctx->layout_interface;
801 struct ivi_layout_layer *ivilayer;
802 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
803 struct ivi_layout_surface **array;
804 int32_t length = 0;
805 uint32_t i;
806
807 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
808
809 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++) {
810 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
811 runner_assert(lyt->layer_add_surface(
812 ivilayer, ivisurfs[i]) == IVI_SUCCEEDED);
813 }
814
815 lyt->commit_changes();
816
817 runner_assert(lyt->get_surfaces_on_layer(
818 ivilayer, &length, &array) == IVI_SUCCEEDED);
819 runner_assert(IVI_TEST_SURFACE_COUNT == length);
820 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
821 runner_assert(array[i] == ivisurfs[i]);
822
823 if (length > 0)
824 free(array);
825
826 runner_assert(lyt->layer_set_render_order(
827 ivilayer, NULL, 0) == IVI_SUCCEEDED);
828
829 for (i = IVI_TEST_SURFACE_COUNT; i-- > 0;)
830 runner_assert(lyt->layer_add_surface(
831 ivilayer, ivisurfs[i]) == IVI_SUCCEEDED);
832
833 lyt->commit_changes();
834
835 runner_assert(lyt->get_surfaces_on_layer(
836 ivilayer, &length, &array) == IVI_SUCCEEDED);
837 runner_assert(IVI_TEST_SURFACE_COUNT == length);
838 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
839 runner_assert(array[i] == ivisurfs[IVI_TEST_SURFACE_COUNT - (i + 1)]);
840
841 if (length > 0)
842 free(array);
843
844 lyt->layer_destroy(ivilayer);
845}
846
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900847RUNNER_TEST(commit_changes_after_render_order_set_surface_destroy)
848{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000849 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900850 struct ivi_layout_layer *ivilayer;
851 struct ivi_layout_surface *ivisurfs[IVI_TEST_SURFACE_COUNT] = {};
852 int i;
853
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000854 ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900855
856 for (i = 0; i < IVI_TEST_SURFACE_COUNT; i++)
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000857 ivisurfs[i] = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(i));
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900858
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000859 runner_assert(lyt->layer_set_render_order(
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900860 ivilayer, ivisurfs, IVI_TEST_SURFACE_COUNT) == IVI_SUCCEEDED);
861}
862
863RUNNER_TEST(cleanup_layer)
864{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000865 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900866 struct ivi_layout_layer *ivilayer;
867
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000868 ivilayer = lyt->get_layer_from_id(IVI_TEST_LAYER_ID(0));
869 lyt->layer_destroy(ivilayer);
Nobuhiko Tanibata0671b4d2015-06-22 15:34:42 +0900870}
871
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900872static void
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000873test_surface_properties_changed_notification_callback(struct wl_listener *listener, void *data)
874
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900875{
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000876 struct test_context *ctx =
877 container_of(listener, struct test_context,
878 surface_property_changed);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000879 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000880 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900881
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000882 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900883
884 ctx->user_flags = 1;
885}
886
887RUNNER_TEST(surface_properties_changed_notification)
888{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000889 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900890 const uint32_t id_surface = IVI_TEST_SURFACE_ID(0);
891 struct ivi_layout_surface *ivisurf;
892
893 ctx->user_flags = 0;
894
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000895 ivisurf = lyt->get_surface_from_id(id_surface);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900896 runner_assert(ivisurf != NULL);
897
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000898 ctx->surface_property_changed.notify = test_surface_properties_changed_notification_callback;
899
900 runner_assert(lyt->surface_add_listener(
901 ivisurf, &ctx->surface_property_changed) == IVI_SUCCEEDED);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900902
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000903 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900904
905 runner_assert(ctx->user_flags == 0);
906
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000907 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900908 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
909
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000910 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900911
912 runner_assert(ctx->user_flags == 1);
913
914 ctx->user_flags = 0;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000915 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900916 ivisurf, 20, 30, 200, 300) == IVI_SUCCEEDED);
917
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000918 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900919
920 runner_assert(ctx->user_flags == 0);
921
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +0000922 // remove surface property changed listener.
923 wl_list_remove(&ctx->surface_property_changed.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900924 ctx->user_flags = 0;
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000925 runner_assert(lyt->surface_set_destination_rectangle(
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900926 ivisurf, 40, 50, 400, 500) == IVI_SUCCEEDED);
927
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000928 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900929
930 runner_assert(ctx->user_flags == 0);
931}
932
933static void
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000934test_surface_configure_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900935{
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000936 struct test_context *ctx =
937 container_of(listener, struct test_context,
938 surface_configured);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000939 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000940 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900941
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000942 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900943
944 ctx->user_flags = 1;
945}
946
947RUNNER_TEST(surface_configure_notification_p1)
948{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000949 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900950
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000951 ctx->surface_configured.notify = test_surface_configure_notification_callback;
952 runner_assert(IVI_SUCCEEDED == lyt->add_listener_configure_surface(&ctx->surface_configured));
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000953 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900954
955 ctx->user_flags = 0;
956}
957
958RUNNER_TEST(surface_configure_notification_p2)
959{
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900960 runner_assert(ctx->user_flags == 1);
961
Ucan, Emre (ADITG/SW1)c49aa5a2016-04-04 08:05:20 +0000962 // remove surface configured listener.
963 wl_list_remove(&ctx->surface_configured.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900964 ctx->user_flags = 0;
965}
966
967RUNNER_TEST(surface_configure_notification_p3)
968{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000969 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900970
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000971 lyt->commit_changes();
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900972 runner_assert(ctx->user_flags == 0);
973}
974
975static void
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000976test_surface_create_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900977{
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000978 struct test_context *ctx =
979 container_of(listener, struct test_context,
980 surface_created);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000981 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000982 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900983
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000984 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900985
986 ctx->user_flags = 1;
987}
988
989RUNNER_TEST(surface_create_notification_p1)
990{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +0000991 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900992
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +0000993 ctx->surface_created.notify = test_surface_create_notification_callback;
994 runner_assert(lyt->add_listener_create_surface(
995 &ctx->surface_created) == IVI_SUCCEEDED);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +0900996
997 ctx->user_flags = 0;
998}
999
1000RUNNER_TEST(surface_create_notification_p2)
1001{
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001002 runner_assert(ctx->user_flags == 1);
1003
Ucan, Emre (ADITG/SW1)970f8312016-04-04 08:05:09 +00001004 // remove surface created listener.
1005 wl_list_remove(&ctx->surface_created.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001006 ctx->user_flags = 0;
1007}
1008
1009RUNNER_TEST(surface_create_notification_p3)
1010{
1011 runner_assert(ctx->user_flags == 0);
1012}
1013
1014static void
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001015test_surface_remove_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001016{
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001017 struct test_context *ctx =
1018 container_of(listener, struct test_context,
1019 surface_removed);
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001020 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001021 struct ivi_layout_surface *ivisurf = data;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001022
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001023 runner_assert_or_return(lyt->get_id_of_surface(ivisurf) == IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001024
1025 ctx->user_flags = 1;
1026}
1027
1028RUNNER_TEST(surface_remove_notification_p1)
1029{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001030 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001031
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001032 ctx->surface_removed.notify = test_surface_remove_notification_callback;
1033 runner_assert(lyt->add_listener_remove_surface(&ctx->surface_removed)
1034 == IVI_SUCCEEDED);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001035
1036 ctx->user_flags = 0;
1037}
1038
1039RUNNER_TEST(surface_remove_notification_p2)
1040{
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001041 runner_assert(ctx->user_flags == 1);
1042
Ucan, Emre (ADITG/SW1)67f0aa82016-04-04 08:05:18 +00001043 // remove surface removed listener.
1044 wl_list_remove(&ctx->surface_removed.link);
Nobuhiko Tanibata915303a2015-06-22 15:35:58 +09001045 ctx->user_flags = 0;
1046}
1047
1048RUNNER_TEST(surface_remove_notification_p3)
1049{
1050 runner_assert(ctx->user_flags == 0);
1051}
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001052
1053static void
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +00001054test_surface_bad_properties_changed_notification_callback(struct wl_listener *listener, void *data)
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001055{
1056}
1057
1058RUNNER_TEST(surface_bad_properties_changed_notification)
1059{
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001060 const struct ivi_layout_interface *lyt = ctx->layout_interface;
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001061 struct ivi_layout_surface *ivisurf;
1062
Ucan, Emre \(ADITG/SW1\)0c0e51e2015-10-15 14:51:41 +00001063 ivisurf = lyt->get_surface_from_id(IVI_TEST_SURFACE_ID(0));
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001064 runner_assert(ivisurf != NULL);
1065
Ucan, Emre (ADITG/SW1)706cb5a2016-04-04 08:05:03 +00001066 ctx->surface_property_changed.notify = test_surface_bad_properties_changed_notification_callback;
1067
1068 runner_assert(lyt->surface_add_listener(
1069 NULL, &ctx->surface_property_changed) == IVI_FAILED);
1070 runner_assert(lyt->surface_add_listener(
1071 ivisurf, NULL) == IVI_FAILED);
Nobuhiko Tanibata0af22d42015-06-22 15:36:21 +09001072}