Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright © 2013 DENSO CORPORATION |
| 3 | * Copyright © 2015 Collabora, Ltd. |
| 4 | * |
Bryce Harrington | 2cc9297 | 2015-06-11 15:39:40 -0700 | [diff] [blame] | 5 | * Permission is hereby granted, free of charge, to any person obtaining |
| 6 | * a copy of this software and associated documentation files (the |
| 7 | * "Software"), to deal in the Software without restriction, including |
| 8 | * without limitation the rights to use, copy, modify, merge, publish, |
| 9 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 10 | * permit persons to whom the Software is furnished to do so, subject to |
| 11 | * the following conditions: |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 12 | * |
Bryce Harrington | 2cc9297 | 2015-06-11 15:39:40 -0700 | [diff] [blame] | 13 | * The above copyright notice and this permission notice (including the |
| 14 | * next paragraph) shall be included in all copies or substantial |
| 15 | * portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 21 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 22 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 24 | * SOFTWARE. |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 25 | */ |
| 26 | |
| 27 | #include "config.h" |
| 28 | |
| 29 | #include <unistd.h> |
| 30 | #include <signal.h> |
| 31 | #include <string.h> |
| 32 | #include <stdbool.h> |
| 33 | |
Jon Cruz | 4678bab | 2015-06-15 15:37:07 -0700 | [diff] [blame] | 34 | #include "src/compositor.h" |
| 35 | #include "ivi-shell/ivi-layout-export.h" |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 36 | #include "ivi-shell/ivi-layout-private.h" |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 37 | #include "ivi-test.h" |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 38 | |
| 39 | struct test_context { |
| 40 | struct weston_compositor *compositor; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 41 | const struct ivi_layout_interface *layout_interface; |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 42 | uint32_t user_flags; |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | static void |
| 46 | iassert_fail(const char *cond, const char *file, int line, |
| 47 | const char *func, struct test_context *ctx) |
| 48 | { |
| 49 | weston_log("Assert failure in %s:%d, %s: '%s'\n", |
| 50 | file, line, func, cond); |
| 51 | weston_compositor_exit_with_code(ctx->compositor, EXIT_FAILURE); |
| 52 | } |
| 53 | |
| 54 | #define iassert(cond) ({ \ |
| 55 | bool b_ = (cond); \ |
| 56 | if (!b_) \ |
| 57 | iassert_fail(#cond, __FILE__, __LINE__, __func__, ctx); \ |
| 58 | b_; \ |
| 59 | }) |
| 60 | |
| 61 | /************************ tests begin ******************************/ |
| 62 | |
| 63 | /* |
| 64 | * These are all internal ivi_layout API tests that do not require |
| 65 | * any client objects. |
| 66 | */ |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 67 | static void |
| 68 | test_surface_bad_visibility(struct test_context *ctx) |
| 69 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 70 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 71 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 72 | iassert(lyt->surface_set_visibility(NULL, true) == IVI_FAILED); |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 73 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 74 | lyt->commit_changes(); |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 75 | } |
| 76 | |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 77 | static void |
| 78 | test_surface_bad_destination_rectangle(struct test_context *ctx) |
| 79 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 80 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 81 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 82 | iassert(lyt->surface_set_destination_rectangle(NULL, 20, 30, 200, 300) == IVI_FAILED); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | static void |
| 86 | test_surface_bad_orientation(struct test_context *ctx) |
| 87 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 88 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 89 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 90 | iassert(lyt->surface_set_orientation(NULL, WL_OUTPUT_TRANSFORM_90) == IVI_FAILED); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 91 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 92 | iassert(lyt->surface_get_orientation(NULL) == WL_OUTPUT_TRANSFORM_NORMAL); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | static void |
| 96 | test_surface_bad_dimension(struct test_context *ctx) |
| 97 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 98 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 99 | struct ivi_layout_surface *ivisurf = NULL; |
| 100 | int32_t dest_width; |
| 101 | int32_t dest_height; |
| 102 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 103 | iassert(lyt->surface_set_dimension(NULL, 200, 300) == IVI_FAILED); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 104 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 105 | lyt->commit_changes(); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 106 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 107 | iassert(lyt->surface_get_dimension(NULL, &dest_width, &dest_height) == IVI_FAILED); |
| 108 | iassert(lyt->surface_get_dimension(ivisurf, NULL, &dest_height) == IVI_FAILED); |
| 109 | iassert(lyt->surface_get_dimension(ivisurf, &dest_width, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 110 | } |
| 111 | |
| 112 | static void |
| 113 | test_surface_bad_position(struct test_context *ctx) |
| 114 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 115 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 116 | struct ivi_layout_surface *ivisurf = NULL; |
| 117 | int32_t dest_x; |
| 118 | int32_t dest_y; |
| 119 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 120 | iassert(lyt->surface_set_position(NULL, 20, 30) == IVI_FAILED); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 121 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 122 | lyt->commit_changes(); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 123 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 124 | iassert(lyt->surface_get_position(NULL, &dest_x, &dest_y) == IVI_FAILED); |
| 125 | iassert(lyt->surface_get_position(ivisurf, NULL, &dest_y) == IVI_FAILED); |
| 126 | iassert(lyt->surface_get_position(ivisurf, &dest_x, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 127 | } |
| 128 | |
| 129 | static void |
| 130 | test_surface_bad_source_rectangle(struct test_context *ctx) |
| 131 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 132 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 133 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 134 | iassert(lyt->surface_set_source_rectangle(NULL, 20, 30, 200, 300) == IVI_FAILED); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | static void |
| 138 | test_surface_bad_properties(struct test_context *ctx) |
| 139 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 140 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 141 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 142 | iassert(lyt->get_properties_of_surface(NULL) == NULL); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 143 | } |
| 144 | |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 145 | static void |
| 146 | test_layer_create(struct test_context *ctx) |
| 147 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 148 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 149 | uint32_t id1; |
| 150 | uint32_t id2; |
| 151 | struct ivi_layout_layer *ivilayer; |
| 152 | struct ivi_layout_layer *new_ivilayer; |
| 153 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 154 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 155 | iassert(ivilayer != NULL); |
| 156 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 157 | iassert(IVI_TEST_LAYER_ID(0) == lyt->get_id_of_layer(ivilayer)); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 158 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 159 | new_ivilayer = lyt->get_layer_from_id(IVI_TEST_LAYER_ID(0)); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 160 | iassert(ivilayer == new_ivilayer); |
| 161 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 162 | id1 = lyt->get_id_of_layer(ivilayer); |
| 163 | id2 = lyt->get_id_of_layer(new_ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 164 | iassert(id1 == id2); |
| 165 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 166 | lyt->layer_destroy(ivilayer); |
| 167 | iassert(lyt->get_layer_from_id(IVI_TEST_LAYER_ID(0)) == NULL); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 168 | } |
| 169 | |
| 170 | static void |
| 171 | test_layer_visibility(struct test_context *ctx) |
| 172 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 173 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 174 | struct ivi_layout_layer *ivilayer; |
| 175 | const struct ivi_layout_layer_properties *prop; |
| 176 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 177 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 178 | iassert(ivilayer != NULL); |
| 179 | |
Ucan, Emre \(ADITG/SW1\) | 17610f2 | 2016-03-04 12:50:07 +0000 | [diff] [blame] | 180 | prop = lyt->get_properties_of_layer(ivilayer); |
| 181 | |
| 182 | iassert(prop->visibility == false); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 183 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 184 | iassert(lyt->layer_set_visibility(ivilayer, true) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 185 | |
Ucan, Emre \(ADITG/SW1\) | 17610f2 | 2016-03-04 12:50:07 +0000 | [diff] [blame] | 186 | iassert(prop->visibility == false); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 187 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 188 | lyt->commit_changes(); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 189 | |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 190 | iassert(prop->visibility == true); |
| 191 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 192 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | static void |
| 196 | test_layer_opacity(struct test_context *ctx) |
| 197 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 198 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 199 | struct ivi_layout_layer *ivilayer; |
| 200 | const struct ivi_layout_layer_properties *prop; |
| 201 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 202 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 203 | iassert(ivilayer != NULL); |
| 204 | |
Ucan, Emre \(ADITG/SW1\) | c3aee1f | 2016-03-04 12:50:16 +0000 | [diff] [blame^] | 205 | prop = lyt->get_properties_of_layer(ivilayer); |
| 206 | iassert(prop->opacity == wl_fixed_from_double(1.0)); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 207 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 208 | iassert(lyt->layer_set_opacity( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 209 | ivilayer, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED); |
| 210 | |
Ucan, Emre \(ADITG/SW1\) | c3aee1f | 2016-03-04 12:50:16 +0000 | [diff] [blame^] | 211 | iassert(prop->opacity == wl_fixed_from_double(1.0)); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 212 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 213 | lyt->commit_changes(); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 214 | |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 215 | iassert(prop->opacity == wl_fixed_from_double(0.5)); |
| 216 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 217 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | static void |
| 221 | test_layer_orientation(struct test_context *ctx) |
| 222 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 223 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 224 | struct ivi_layout_layer *ivilayer; |
| 225 | const struct ivi_layout_layer_properties *prop; |
| 226 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 227 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 228 | iassert(ivilayer != NULL); |
| 229 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 230 | iassert(lyt->layer_get_orientation(ivilayer) == WL_OUTPUT_TRANSFORM_NORMAL); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 231 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 232 | iassert(lyt->layer_set_orientation( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 233 | ivilayer, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED); |
| 234 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 235 | iassert(lyt->layer_get_orientation(ivilayer) == WL_OUTPUT_TRANSFORM_NORMAL); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 236 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 237 | lyt->commit_changes(); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 238 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 239 | iassert(lyt->layer_get_orientation(ivilayer) == WL_OUTPUT_TRANSFORM_90); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 240 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 241 | prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 242 | iassert(prop->orientation == WL_OUTPUT_TRANSFORM_90); |
| 243 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 244 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | static void |
| 248 | test_layer_dimension(struct test_context *ctx) |
| 249 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 250 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 251 | struct ivi_layout_layer *ivilayer; |
| 252 | const struct ivi_layout_layer_properties *prop; |
| 253 | int32_t dest_width; |
| 254 | int32_t dest_height; |
| 255 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 256 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 257 | iassert(ivilayer != NULL); |
| 258 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 259 | iassert(lyt->layer_get_dimension( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 260 | ivilayer, &dest_width, &dest_height) == IVI_SUCCEEDED); |
| 261 | iassert(dest_width == 200); |
| 262 | iassert(dest_height == 300); |
| 263 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 264 | iassert(lyt->layer_set_dimension(ivilayer, 400, 600) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 265 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 266 | iassert(lyt->layer_get_dimension( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 267 | ivilayer, &dest_width, &dest_height) == IVI_SUCCEEDED); |
| 268 | iassert(dest_width == 200); |
| 269 | iassert(dest_height == 300); |
| 270 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 271 | lyt->commit_changes(); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 272 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 273 | iassert(IVI_SUCCEEDED == lyt->layer_get_dimension( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 274 | ivilayer, &dest_width, &dest_height)); |
| 275 | iassert(dest_width == 400); |
| 276 | iassert(dest_height == 600); |
| 277 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 278 | prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 279 | iassert(prop->dest_width == 400); |
| 280 | iassert(prop->dest_height == 600); |
| 281 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 282 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | static void |
| 286 | test_layer_position(struct test_context *ctx) |
| 287 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 288 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 289 | struct ivi_layout_layer *ivilayer; |
| 290 | const struct ivi_layout_layer_properties *prop; |
| 291 | int32_t dest_x; |
| 292 | int32_t dest_y; |
| 293 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 294 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 295 | iassert(ivilayer != NULL); |
| 296 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 297 | iassert(lyt->layer_get_position( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 298 | ivilayer, &dest_x, &dest_y) == IVI_SUCCEEDED); |
| 299 | iassert(dest_x == 0); |
| 300 | iassert(dest_y == 0); |
| 301 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 302 | iassert(lyt->layer_set_position(ivilayer, 20, 30) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 303 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 304 | iassert(lyt->layer_get_position( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 305 | ivilayer, &dest_x, &dest_y) == IVI_SUCCEEDED); |
| 306 | iassert(dest_x == 0); |
| 307 | iassert(dest_y == 0); |
| 308 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 309 | lyt->commit_changes(); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 310 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 311 | iassert(lyt->layer_get_position( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 312 | ivilayer, &dest_x, &dest_y) == IVI_SUCCEEDED); |
| 313 | iassert(dest_x == 20); |
| 314 | iassert(dest_y == 30); |
| 315 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 316 | prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 317 | iassert(prop->dest_x == 20); |
| 318 | iassert(prop->dest_y == 30); |
| 319 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 320 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 321 | } |
| 322 | |
| 323 | static void |
| 324 | test_layer_destination_rectangle(struct test_context *ctx) |
| 325 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 326 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 327 | struct ivi_layout_layer *ivilayer; |
| 328 | const struct ivi_layout_layer_properties *prop; |
| 329 | int32_t dest_width; |
| 330 | int32_t dest_height; |
| 331 | int32_t dest_x; |
| 332 | int32_t dest_y; |
| 333 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 334 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 335 | iassert(ivilayer != NULL); |
| 336 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 337 | prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 338 | iassert(prop->dest_width == 200); |
| 339 | iassert(prop->dest_height == 300); |
| 340 | iassert(prop->dest_x == 0); |
| 341 | iassert(prop->dest_y == 0); |
| 342 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 343 | iassert(lyt->layer_set_destination_rectangle( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 344 | ivilayer, 20, 30, 400, 600) == IVI_SUCCEEDED); |
| 345 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 346 | prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 347 | iassert(prop->dest_width == 200); |
| 348 | iassert(prop->dest_height == 300); |
| 349 | iassert(prop->dest_x == 0); |
| 350 | iassert(prop->dest_y == 0); |
| 351 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 352 | lyt->commit_changes(); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 353 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 354 | iassert(lyt->layer_get_dimension( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 355 | ivilayer, &dest_width, &dest_height) == IVI_SUCCEEDED); |
| 356 | iassert(dest_width == 400); |
| 357 | iassert(dest_height == 600); |
| 358 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 359 | iassert(lyt->layer_get_position( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 360 | ivilayer, &dest_x, &dest_y) == IVI_SUCCEEDED); |
| 361 | iassert(dest_x == 20); |
| 362 | iassert(dest_y == 30); |
| 363 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 364 | prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 365 | iassert(prop->dest_width == 400); |
| 366 | iassert(prop->dest_height == 600); |
| 367 | iassert(prop->dest_x == 20); |
| 368 | iassert(prop->dest_y == 30); |
| 369 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 370 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | static void |
| 374 | test_layer_source_rectangle(struct test_context *ctx) |
| 375 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 376 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 377 | struct ivi_layout_layer *ivilayer; |
| 378 | const struct ivi_layout_layer_properties *prop; |
| 379 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 380 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 381 | iassert(ivilayer != NULL); |
| 382 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 383 | prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 384 | iassert(prop->source_width == 200); |
| 385 | iassert(prop->source_height == 300); |
| 386 | iassert(prop->source_x == 0); |
| 387 | iassert(prop->source_y == 0); |
| 388 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 389 | iassert(lyt->layer_set_source_rectangle( |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 390 | ivilayer, 20, 30, 400, 600) == IVI_SUCCEEDED); |
| 391 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 392 | prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 393 | iassert(prop->source_width == 200); |
| 394 | iassert(prop->source_height == 300); |
| 395 | iassert(prop->source_x == 0); |
| 396 | iassert(prop->source_y == 0); |
| 397 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 398 | lyt->commit_changes(); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 399 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 400 | prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 401 | iassert(prop->source_width == 400); |
| 402 | iassert(prop->source_height == 600); |
| 403 | iassert(prop->source_x == 20); |
| 404 | iassert(prop->source_y == 30); |
| 405 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 406 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 407 | } |
| 408 | |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 409 | static void |
| 410 | test_layer_bad_remove(struct test_context *ctx) |
| 411 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 412 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
| 413 | lyt->layer_destroy(NULL); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 414 | } |
| 415 | |
| 416 | static void |
| 417 | test_layer_bad_visibility(struct test_context *ctx) |
| 418 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 419 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 420 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 421 | iassert(lyt->layer_set_visibility(NULL, true) == IVI_FAILED); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 422 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 423 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 424 | } |
| 425 | |
| 426 | static void |
| 427 | test_layer_bad_opacity(struct test_context *ctx) |
| 428 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 429 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 430 | struct ivi_layout_layer *ivilayer; |
Ucan, Emre \(ADITG/SW1\) | c3aee1f | 2016-03-04 12:50:16 +0000 | [diff] [blame^] | 431 | const struct ivi_layout_layer_properties *prop; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 432 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 433 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 434 | iassert(ivilayer != NULL); |
| 435 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 436 | iassert(lyt->layer_set_opacity( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 437 | NULL, wl_fixed_from_double(0.3)) == IVI_FAILED); |
| 438 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 439 | iassert(lyt->layer_set_opacity( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 440 | ivilayer, wl_fixed_from_double(0.3)) == IVI_SUCCEEDED); |
| 441 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 442 | iassert(lyt->layer_set_opacity( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 443 | ivilayer, wl_fixed_from_double(-1)) == IVI_FAILED); |
| 444 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 445 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 446 | |
Ucan, Emre \(ADITG/SW1\) | c3aee1f | 2016-03-04 12:50:16 +0000 | [diff] [blame^] | 447 | prop = lyt->get_properties_of_layer(ivilayer); |
| 448 | iassert(prop->opacity == wl_fixed_from_double(0.3)); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 449 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 450 | iassert(lyt->layer_set_opacity( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 451 | ivilayer, wl_fixed_from_double(1.1)) == IVI_FAILED); |
| 452 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 453 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 454 | |
Ucan, Emre \(ADITG/SW1\) | c3aee1f | 2016-03-04 12:50:16 +0000 | [diff] [blame^] | 455 | iassert(prop->opacity == wl_fixed_from_double(0.3)); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 456 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 457 | iassert(lyt->layer_set_opacity( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 458 | NULL, wl_fixed_from_double(0.5)) == IVI_FAILED); |
| 459 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 460 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 461 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 462 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 463 | } |
| 464 | |
| 465 | static void |
| 466 | test_layer_bad_destination_rectangle(struct test_context *ctx) |
| 467 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 468 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 469 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 470 | iassert(lyt->layer_set_destination_rectangle( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 471 | NULL, 20, 30, 200, 300) == IVI_FAILED); |
| 472 | } |
| 473 | |
| 474 | static void |
| 475 | test_layer_bad_orientation(struct test_context *ctx) |
| 476 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 477 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 478 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 479 | iassert(lyt->layer_set_orientation( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 480 | NULL, WL_OUTPUT_TRANSFORM_90) == IVI_FAILED); |
| 481 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 482 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 483 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 484 | iassert(lyt->layer_get_orientation(NULL) == WL_OUTPUT_TRANSFORM_NORMAL); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 485 | } |
| 486 | |
| 487 | static void |
| 488 | test_layer_bad_dimension(struct test_context *ctx) |
| 489 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 490 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 491 | struct ivi_layout_layer *ivilayer; |
| 492 | int32_t dest_width; |
| 493 | int32_t dest_height; |
| 494 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 495 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 496 | iassert(ivilayer != NULL); |
| 497 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 498 | iassert(lyt->layer_set_dimension(NULL, 200, 300) == IVI_FAILED); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 499 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 500 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 501 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 502 | iassert(lyt->layer_get_dimension( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 503 | NULL, &dest_width, &dest_height) == IVI_FAILED); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 504 | iassert(lyt->layer_get_dimension( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 505 | ivilayer, NULL, &dest_height) == IVI_FAILED); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 506 | iassert(lyt->layer_get_dimension( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 507 | ivilayer, &dest_width, NULL) == IVI_FAILED); |
| 508 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 509 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 510 | } |
| 511 | |
| 512 | static void |
| 513 | test_layer_bad_position(struct test_context *ctx) |
| 514 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 515 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 516 | struct ivi_layout_layer *ivilayer; |
| 517 | int32_t dest_x; |
| 518 | int32_t dest_y; |
| 519 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 520 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 521 | iassert(ivilayer != NULL); |
| 522 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 523 | iassert(lyt->layer_set_position(NULL, 20, 30) == IVI_FAILED); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 524 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 525 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 526 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 527 | iassert(lyt->layer_get_position(NULL, &dest_x, &dest_y) == IVI_FAILED); |
| 528 | iassert(lyt->layer_get_position(ivilayer, NULL, &dest_y) == IVI_FAILED); |
| 529 | iassert(lyt->layer_get_position(ivilayer, &dest_x, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 530 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 531 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 532 | } |
| 533 | |
| 534 | static void |
| 535 | test_layer_bad_source_rectangle(struct test_context *ctx) |
| 536 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 537 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 538 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 539 | iassert(lyt->layer_set_source_rectangle( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 540 | NULL, 20, 30, 200, 300) == IVI_FAILED); |
| 541 | } |
| 542 | |
| 543 | static void |
| 544 | test_layer_bad_properties(struct test_context *ctx) |
| 545 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 546 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 547 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 548 | iassert(lyt->get_properties_of_layer(NULL) == NULL); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 549 | } |
| 550 | |
| 551 | static void |
| 552 | test_commit_changes_after_visibility_set_layer_destroy(struct test_context *ctx) |
| 553 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 554 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 555 | struct ivi_layout_layer *ivilayer; |
| 556 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 557 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 558 | iassert(ivilayer != NULL); |
| 559 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 560 | iassert(lyt->layer_set_visibility(ivilayer, true) == IVI_SUCCEEDED); |
| 561 | lyt->layer_destroy(ivilayer); |
| 562 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 563 | } |
| 564 | |
| 565 | static void |
| 566 | test_commit_changes_after_opacity_set_layer_destroy(struct test_context *ctx) |
| 567 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 568 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 569 | struct ivi_layout_layer *ivilayer; |
| 570 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 571 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 572 | iassert(ivilayer != NULL); |
| 573 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 574 | iassert(lyt->layer_set_opacity( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 575 | ivilayer, wl_fixed_from_double(0.5)) == IVI_SUCCEEDED); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 576 | lyt->layer_destroy(ivilayer); |
| 577 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 578 | } |
| 579 | |
| 580 | static void |
| 581 | test_commit_changes_after_orientation_set_layer_destroy(struct test_context *ctx) |
| 582 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 583 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 584 | struct ivi_layout_layer *ivilayer; |
| 585 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 586 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 587 | iassert(ivilayer != NULL); |
| 588 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 589 | iassert(lyt->layer_set_orientation( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 590 | ivilayer, WL_OUTPUT_TRANSFORM_90) == IVI_SUCCEEDED); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 591 | lyt->layer_destroy(ivilayer); |
| 592 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 593 | } |
| 594 | |
| 595 | static void |
| 596 | test_commit_changes_after_dimension_set_layer_destroy(struct test_context *ctx) |
| 597 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 598 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 599 | struct ivi_layout_layer *ivilayer; |
| 600 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 601 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 602 | iassert(ivilayer != NULL); |
| 603 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 604 | iassert(lyt->layer_set_dimension(ivilayer, 200, 300) == IVI_SUCCEEDED); |
| 605 | lyt->layer_destroy(ivilayer); |
| 606 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 607 | } |
| 608 | |
| 609 | static void |
| 610 | test_commit_changes_after_position_set_layer_destroy(struct test_context *ctx) |
| 611 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 612 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 613 | struct ivi_layout_layer *ivilayer; |
| 614 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 615 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 616 | iassert(ivilayer != NULL); |
| 617 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 618 | iassert(lyt->layer_set_position(ivilayer, 20, 30) == IVI_SUCCEEDED); |
| 619 | lyt->layer_destroy(ivilayer); |
| 620 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 621 | } |
| 622 | |
| 623 | static void |
| 624 | test_commit_changes_after_source_rectangle_set_layer_destroy(struct test_context *ctx) |
| 625 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 626 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 627 | struct ivi_layout_layer *ivilayer; |
| 628 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 629 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 630 | iassert(ivilayer != NULL); |
| 631 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 632 | iassert(lyt->layer_set_source_rectangle( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 633 | ivilayer, 20, 30, 200, 300) == IVI_SUCCEEDED); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 634 | lyt->layer_destroy(ivilayer); |
| 635 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 636 | } |
| 637 | |
| 638 | static void |
| 639 | test_commit_changes_after_destination_rectangle_set_layer_destroy(struct test_context *ctx) |
| 640 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 641 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 642 | struct ivi_layout_layer *ivilayer; |
| 643 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 644 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 645 | iassert(ivilayer != NULL); |
| 646 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 647 | iassert(lyt->layer_set_destination_rectangle( |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 648 | ivilayer, 20, 30, 200, 300) == IVI_SUCCEEDED); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 649 | lyt->layer_destroy(ivilayer); |
| 650 | lyt->commit_changes(); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 651 | } |
| 652 | |
| 653 | static void |
| 654 | test_layer_create_duplicate(struct test_context *ctx) |
| 655 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 656 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 657 | struct ivi_layout_layer *ivilayer; |
| 658 | struct ivi_layout_layer *duplicatelayer; |
| 659 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 660 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 661 | iassert(ivilayer != NULL); |
| 662 | |
| 663 | if (ivilayer != NULL) |
| 664 | iassert(ivilayer->ref_count == 1); |
| 665 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 666 | duplicatelayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 667 | iassert(ivilayer == duplicatelayer); |
| 668 | |
| 669 | if (ivilayer != NULL) |
| 670 | iassert(ivilayer->ref_count == 2); |
| 671 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 672 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 673 | |
| 674 | if (ivilayer != NULL) |
| 675 | iassert(ivilayer->ref_count == 1); |
| 676 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 677 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 678 | } |
| 679 | |
| 680 | static void |
| 681 | test_get_layer_after_destory_layer(struct test_context *ctx) |
| 682 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 683 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 684 | struct ivi_layout_layer *ivilayer; |
| 685 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 686 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 687 | iassert(ivilayer != NULL); |
| 688 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 689 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 690 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 691 | ivilayer = lyt->get_layer_from_id(IVI_TEST_LAYER_ID(0)); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 692 | iassert(ivilayer == NULL); |
| 693 | } |
| 694 | |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 695 | static void |
| 696 | test_screen_id(struct test_context *ctx) |
| 697 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 698 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 699 | struct ivi_layout_screen **iviscrns; |
| 700 | int32_t screen_length = 0; |
| 701 | uint32_t id_screen; |
| 702 | int32_t i; |
| 703 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 704 | iassert(lyt->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 705 | iassert(screen_length > 0); |
| 706 | |
| 707 | for (i = 0; i < screen_length; ++i) { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 708 | id_screen = lyt->get_id_of_screen(iviscrns[i]); |
| 709 | iassert(lyt->get_screen_from_id(id_screen) == iviscrns[i]); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 710 | } |
| 711 | |
| 712 | if (screen_length > 0) |
| 713 | free(iviscrns); |
| 714 | } |
| 715 | |
| 716 | static void |
| 717 | test_screen_resolution(struct test_context *ctx) |
| 718 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 719 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 720 | struct ivi_layout_screen **iviscrns; |
| 721 | int32_t screen_length = 0; |
| 722 | struct weston_output *output; |
| 723 | int32_t width; |
| 724 | int32_t height; |
| 725 | int32_t i; |
| 726 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 727 | iassert(lyt->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 728 | iassert(screen_length > 0); |
| 729 | |
| 730 | for (i = 0; i < screen_length; ++i) { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 731 | output = lyt->screen_get_output(iviscrns[i]); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 732 | iassert(output != NULL); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 733 | iassert(lyt->get_screen_resolution( |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 734 | iviscrns[i], &width, &height) == IVI_SUCCEEDED); |
| 735 | iassert(width == output->current_mode->width); |
| 736 | iassert(height == output->current_mode->height); |
| 737 | } |
| 738 | |
| 739 | if (screen_length > 0) |
| 740 | free(iviscrns); |
| 741 | } |
| 742 | |
| 743 | static void |
| 744 | test_screen_render_order(struct test_context *ctx) |
| 745 | { |
| 746 | #define LAYER_NUM (3) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 747 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 748 | struct ivi_layout_screen **iviscrns; |
| 749 | int32_t screen_length = 0; |
| 750 | struct ivi_layout_screen *iviscrn; |
| 751 | struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; |
| 752 | struct ivi_layout_layer **array; |
| 753 | int32_t length = 0; |
| 754 | uint32_t i; |
| 755 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 756 | iassert(lyt->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 757 | iassert(screen_length > 0); |
| 758 | |
| 759 | if (screen_length <= 0) |
| 760 | return; |
| 761 | |
| 762 | iviscrn = iviscrns[0]; |
| 763 | |
| 764 | for (i = 0; i < LAYER_NUM; i++) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 765 | ivilayers[i] = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(i), 200, 300); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 766 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 767 | iassert(lyt->screen_set_render_order(iviscrn, ivilayers, LAYER_NUM) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 768 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 769 | lyt->commit_changes(); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 770 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 771 | iassert(lyt->get_layers_on_screen(iviscrn, &length, &array) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 772 | iassert(length == LAYER_NUM); |
| 773 | for (i = 0; i < LAYER_NUM; i++) |
| 774 | iassert(array[i] == ivilayers[i]); |
| 775 | |
| 776 | if (length > 0) |
| 777 | free(array); |
| 778 | |
| 779 | array = NULL; |
| 780 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 781 | iassert(lyt->screen_set_render_order(iviscrn, NULL, 0) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 782 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 783 | lyt->commit_changes(); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 784 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 785 | iassert(lyt->get_layers_on_screen(iviscrn, &length, &array) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 786 | iassert(length == 0 && array == NULL); |
| 787 | |
| 788 | for (i = 0; i < LAYER_NUM; i++) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 789 | lyt->layer_destroy(ivilayers[i]); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 790 | |
| 791 | free(iviscrns); |
| 792 | #undef LAYER_NUM |
| 793 | } |
| 794 | |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 795 | static void |
| 796 | test_screen_bad_resolution(struct test_context *ctx) |
| 797 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 798 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 799 | struct ivi_layout_screen **iviscrns; |
| 800 | int32_t screen_length = 0; |
| 801 | struct ivi_layout_screen *iviscrn; |
| 802 | int32_t width; |
| 803 | int32_t height; |
| 804 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 805 | iassert(lyt->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 806 | iassert(screen_length > 0); |
| 807 | |
| 808 | if (screen_length <= 0) |
| 809 | return; |
| 810 | |
| 811 | iviscrn = iviscrns[0]; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 812 | iassert(lyt->get_screen_resolution(NULL, &width, &height) == IVI_FAILED); |
| 813 | iassert(lyt->get_screen_resolution(iviscrn, NULL, &height) == IVI_FAILED); |
| 814 | iassert(lyt->get_screen_resolution(iviscrn, &width, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 815 | free(iviscrns); |
| 816 | } |
| 817 | |
| 818 | static void |
| 819 | test_screen_bad_render_order(struct test_context *ctx) |
| 820 | { |
| 821 | #define LAYER_NUM (3) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 822 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 823 | struct ivi_layout_screen **iviscrns; |
| 824 | int32_t screen_length; |
| 825 | struct ivi_layout_screen *iviscrn; |
| 826 | struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; |
| 827 | struct ivi_layout_layer **array; |
| 828 | int32_t length = 0; |
| 829 | uint32_t i; |
| 830 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 831 | iassert(lyt->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 832 | iassert(screen_length > 0); |
| 833 | |
| 834 | if (screen_length <= 0) |
| 835 | return; |
| 836 | |
| 837 | iviscrn = iviscrns[0]; |
| 838 | |
| 839 | for (i = 0; i < LAYER_NUM; i++) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 840 | ivilayers[i] = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(i), 200, 300); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 841 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 842 | iassert(lyt->screen_set_render_order(NULL, ivilayers, LAYER_NUM) == IVI_FAILED); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 843 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 844 | lyt->commit_changes(); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 845 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 846 | iassert(lyt->get_layers_on_screen(NULL, &length, &array) == IVI_FAILED); |
| 847 | iassert(lyt->get_layers_on_screen(iviscrn, NULL, &array) == IVI_FAILED); |
| 848 | iassert(lyt->get_layers_on_screen(iviscrn, &length, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 849 | |
| 850 | for (i = 0; i < LAYER_NUM; i++) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 851 | lyt->layer_destroy(ivilayers[i]); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 852 | |
| 853 | free(iviscrns); |
| 854 | #undef LAYER_NUM |
| 855 | } |
| 856 | |
| 857 | static void |
| 858 | test_commit_changes_after_render_order_set_layer_destroy( |
| 859 | struct test_context *ctx) |
| 860 | { |
| 861 | #define LAYER_NUM (3) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 862 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 863 | struct ivi_layout_screen **iviscrns; |
| 864 | int32_t screen_length; |
| 865 | struct ivi_layout_screen *iviscrn; |
| 866 | struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; |
| 867 | uint32_t i; |
| 868 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 869 | iassert(lyt->get_screens(&screen_length, &iviscrns) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 870 | iassert(screen_length > 0); |
| 871 | |
| 872 | if (screen_length <= 0) |
| 873 | return; |
| 874 | |
| 875 | iviscrn = iviscrns[0]; |
| 876 | |
| 877 | for (i = 0; i < LAYER_NUM; i++) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 878 | ivilayers[i] = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(i), 200, 300); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 879 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 880 | iassert(lyt->screen_set_render_order(iviscrn, ivilayers, LAYER_NUM) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 881 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 882 | lyt->layer_destroy(ivilayers[1]); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 883 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 884 | lyt->commit_changes(); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 885 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 886 | lyt->layer_destroy(ivilayers[0]); |
| 887 | lyt->layer_destroy(ivilayers[2]); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 888 | |
| 889 | free(iviscrns); |
| 890 | #undef LAYER_NUM |
| 891 | } |
| 892 | |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 893 | static void |
| 894 | test_layer_properties_changed_notification_callback(struct ivi_layout_layer *ivilayer, |
| 895 | const struct ivi_layout_layer_properties *prop, |
| 896 | enum ivi_layout_notification_mask mask, |
| 897 | void *userdata) |
| 898 | { |
| 899 | struct test_context *ctx = userdata; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 900 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 901 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 902 | iassert(lyt->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0)); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 903 | iassert(prop->source_width == 200); |
| 904 | iassert(prop->source_height == 300); |
| 905 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 906 | if (lyt->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0) && |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 907 | prop->source_width == 200 && prop->source_height == 300) |
| 908 | ctx->user_flags = 1; |
| 909 | } |
| 910 | |
| 911 | static void |
| 912 | test_layer_properties_changed_notification(struct test_context *ctx) |
| 913 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 914 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 915 | struct ivi_layout_layer *ivilayer; |
| 916 | |
| 917 | ctx->user_flags = 0; |
| 918 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 919 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 920 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 921 | iassert(lyt->layer_add_notification(ivilayer, test_layer_properties_changed_notification_callback, ctx) == IVI_SUCCEEDED); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 922 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 923 | lyt->commit_changes(); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 924 | |
| 925 | iassert(ctx->user_flags == 0); |
| 926 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 927 | iassert(lyt->layer_set_destination_rectangle( |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 928 | ivilayer, 20, 30, 200, 300) == IVI_SUCCEEDED); |
| 929 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 930 | lyt->commit_changes(); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 931 | |
| 932 | iassert(ctx->user_flags == 1); |
| 933 | |
| 934 | ctx->user_flags = 0; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 935 | iassert(lyt->layer_set_destination_rectangle( |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 936 | ivilayer, 20, 30, 200, 300) == IVI_SUCCEEDED); |
| 937 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 938 | lyt->commit_changes(); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 939 | |
| 940 | iassert(ctx->user_flags == 0); |
| 941 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 942 | lyt->layer_remove_notification(ivilayer); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 943 | |
| 944 | ctx->user_flags = 0; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 945 | lyt->commit_changes(); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 946 | |
| 947 | iassert(ctx->user_flags == 0); |
| 948 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 949 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 950 | } |
| 951 | |
| 952 | static void |
| 953 | test_layer_create_notification_callback(struct ivi_layout_layer *ivilayer, |
| 954 | void *userdata) |
| 955 | { |
| 956 | struct test_context *ctx = userdata; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 957 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
| 958 | const struct ivi_layout_layer_properties *prop = lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 959 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 960 | iassert(lyt->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0)); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 961 | iassert(prop->source_width == 200); |
| 962 | iassert(prop->source_height == 300); |
| 963 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 964 | if (lyt->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0) && |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 965 | prop->source_width == 200 && prop->source_height == 300) |
| 966 | ctx->user_flags = 1; |
| 967 | } |
| 968 | |
| 969 | static void |
| 970 | test_layer_create_notification(struct test_context *ctx) |
| 971 | { |
| 972 | #define LAYER_NUM (2) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 973 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 974 | static const uint32_t layers[LAYER_NUM] = {IVI_TEST_LAYER_ID(0), IVI_TEST_LAYER_ID(1)}; |
| 975 | struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; |
| 976 | |
| 977 | ctx->user_flags = 0; |
| 978 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 979 | iassert(lyt->add_notification_create_layer( |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 980 | test_layer_create_notification_callback, ctx) == IVI_SUCCEEDED); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 981 | ivilayers[0] = lyt->layer_create_with_dimension(layers[0], 200, 300); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 982 | |
| 983 | iassert(ctx->user_flags == 1); |
| 984 | |
| 985 | ctx->user_flags = 0; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 986 | lyt->remove_notification_create_layer(test_layer_create_notification_callback, ctx); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 987 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 988 | ivilayers[1] = lyt->layer_create_with_dimension(layers[1], 400, 500); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 989 | |
| 990 | iassert(ctx->user_flags == 0); |
| 991 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 992 | lyt->layer_destroy(ivilayers[0]); |
| 993 | lyt->layer_destroy(ivilayers[1]); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 994 | #undef LAYER_NUM |
| 995 | } |
| 996 | |
| 997 | static void |
| 998 | test_layer_remove_notification_callback(struct ivi_layout_layer *ivilayer, |
| 999 | void *userdata) |
| 1000 | { |
| 1001 | struct test_context *ctx = userdata; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1002 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 1003 | const struct ivi_layout_layer_properties *prop = |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1004 | lyt->get_properties_of_layer(ivilayer); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 1005 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1006 | iassert(lyt->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0)); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 1007 | iassert(prop->source_width == 200); |
| 1008 | iassert(prop->source_height == 300); |
| 1009 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1010 | if (lyt->get_id_of_layer(ivilayer) == IVI_TEST_LAYER_ID(0) && |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 1011 | prop->source_width == 200 && prop->source_height == 300) |
| 1012 | ctx->user_flags = 1; |
| 1013 | } |
| 1014 | |
| 1015 | static void |
| 1016 | test_layer_remove_notification(struct test_context *ctx) |
| 1017 | { |
| 1018 | #define LAYER_NUM (2) |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1019 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 1020 | static const uint32_t layers[LAYER_NUM] = {IVI_TEST_LAYER_ID(0), IVI_TEST_LAYER_ID(1)}; |
| 1021 | struct ivi_layout_layer *ivilayers[LAYER_NUM] = {}; |
| 1022 | |
| 1023 | ctx->user_flags = 0; |
| 1024 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1025 | ivilayers[0] = lyt->layer_create_with_dimension(layers[0], 200, 300); |
| 1026 | iassert(lyt->add_notification_remove_layer( |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 1027 | test_layer_remove_notification_callback, ctx) == IVI_SUCCEEDED); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1028 | lyt->layer_destroy(ivilayers[0]); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 1029 | |
| 1030 | iassert(ctx->user_flags == 1); |
| 1031 | |
| 1032 | ctx->user_flags = 0; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1033 | ivilayers[1] = lyt->layer_create_with_dimension(layers[1], 250, 350); |
| 1034 | lyt->remove_notification_remove_layer(test_layer_remove_notification_callback, ctx); |
| 1035 | lyt->layer_destroy(ivilayers[1]); |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 1036 | |
| 1037 | iassert(ctx->user_flags == 0); |
| 1038 | #undef LAYER_NUM |
| 1039 | } |
| 1040 | |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1041 | static void |
| 1042 | test_layer_bad_properties_changed_notification_callback(struct ivi_layout_layer *ivilayer, |
| 1043 | const struct ivi_layout_layer_properties *prop, |
| 1044 | enum ivi_layout_notification_mask mask, |
| 1045 | void *userdata) |
| 1046 | { |
| 1047 | } |
| 1048 | |
| 1049 | static void |
| 1050 | test_layer_bad_properties_changed_notification(struct test_context *ctx) |
| 1051 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1052 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1053 | struct ivi_layout_layer *ivilayer; |
| 1054 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1055 | ivilayer = lyt->layer_create_with_dimension(IVI_TEST_LAYER_ID(0), 200, 300); |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1056 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1057 | iassert(lyt->layer_add_notification( |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1058 | NULL, test_layer_bad_properties_changed_notification_callback, NULL) == IVI_FAILED); |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1059 | iassert(lyt->layer_add_notification(ivilayer, NULL, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1060 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1061 | lyt->layer_destroy(ivilayer); |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1062 | } |
| 1063 | |
| 1064 | static void |
| 1065 | test_surface_bad_configure_notification(struct test_context *ctx) |
| 1066 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1067 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1068 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1069 | iassert(lyt->add_notification_configure_surface(NULL, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1070 | } |
| 1071 | |
| 1072 | static void |
| 1073 | test_layer_bad_create_notification(struct test_context *ctx) |
| 1074 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1075 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1076 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1077 | iassert(lyt->add_notification_create_layer(NULL, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1078 | } |
| 1079 | |
| 1080 | static void |
| 1081 | test_surface_bad_create_notification(struct test_context *ctx) |
| 1082 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1083 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1084 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1085 | iassert(lyt->add_notification_create_surface(NULL, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1086 | } |
| 1087 | |
| 1088 | static void |
| 1089 | test_layer_bad_remove_notification(struct test_context *ctx) |
| 1090 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1091 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1092 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1093 | iassert(lyt->add_notification_remove_layer(NULL, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1094 | } |
| 1095 | |
| 1096 | static void |
| 1097 | test_surface_bad_remove_notification(struct test_context *ctx) |
| 1098 | { |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1099 | const struct ivi_layout_interface *lyt = ctx->layout_interface; |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1100 | |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1101 | iassert(lyt->add_notification_remove_surface(NULL, NULL) == IVI_FAILED); |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1102 | } |
| 1103 | |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 1104 | /************************ tests end ********************************/ |
| 1105 | |
| 1106 | static void |
| 1107 | run_internal_tests(void *data) |
| 1108 | { |
| 1109 | struct test_context *ctx = data; |
| 1110 | |
| 1111 | test_surface_bad_visibility(ctx); |
Nobuhiko Tanibata | 16ed543 | 2015-06-22 15:33:59 +0900 | [diff] [blame] | 1112 | test_surface_bad_destination_rectangle(ctx); |
| 1113 | test_surface_bad_orientation(ctx); |
| 1114 | test_surface_bad_dimension(ctx); |
| 1115 | test_surface_bad_position(ctx); |
| 1116 | test_surface_bad_source_rectangle(ctx); |
| 1117 | test_surface_bad_properties(ctx); |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 1118 | |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 1119 | test_layer_create(ctx); |
| 1120 | test_layer_visibility(ctx); |
| 1121 | test_layer_opacity(ctx); |
| 1122 | test_layer_orientation(ctx); |
| 1123 | test_layer_dimension(ctx); |
| 1124 | test_layer_position(ctx); |
| 1125 | test_layer_destination_rectangle(ctx); |
| 1126 | test_layer_source_rectangle(ctx); |
Nobuhiko Tanibata | 17d4494 | 2015-06-22 15:35:12 +0900 | [diff] [blame] | 1127 | test_layer_bad_remove(ctx); |
| 1128 | test_layer_bad_visibility(ctx); |
| 1129 | test_layer_bad_opacity(ctx); |
| 1130 | test_layer_bad_destination_rectangle(ctx); |
| 1131 | test_layer_bad_orientation(ctx); |
| 1132 | test_layer_bad_dimension(ctx); |
| 1133 | test_layer_bad_position(ctx); |
| 1134 | test_layer_bad_source_rectangle(ctx); |
| 1135 | test_layer_bad_properties(ctx); |
| 1136 | test_commit_changes_after_visibility_set_layer_destroy(ctx); |
| 1137 | test_commit_changes_after_opacity_set_layer_destroy(ctx); |
| 1138 | test_commit_changes_after_orientation_set_layer_destroy(ctx); |
| 1139 | test_commit_changes_after_dimension_set_layer_destroy(ctx); |
| 1140 | test_commit_changes_after_position_set_layer_destroy(ctx); |
| 1141 | test_commit_changes_after_source_rectangle_set_layer_destroy(ctx); |
| 1142 | test_commit_changes_after_destination_rectangle_set_layer_destroy(ctx); |
| 1143 | test_layer_create_duplicate(ctx); |
| 1144 | test_get_layer_after_destory_layer(ctx); |
Nobuhiko Tanibata | 9e992d9 | 2015-06-22 15:34:18 +0900 | [diff] [blame] | 1145 | |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 1146 | test_screen_id(ctx); |
| 1147 | test_screen_resolution(ctx); |
| 1148 | test_screen_render_order(ctx); |
Nobuhiko Tanibata | 83c20bc | 2015-06-22 15:35:39 +0900 | [diff] [blame] | 1149 | test_screen_bad_resolution(ctx); |
| 1150 | test_screen_bad_render_order(ctx); |
| 1151 | test_commit_changes_after_render_order_set_layer_destroy(ctx); |
| 1152 | |
Nobuhiko Tanibata | 495c6ef | 2015-06-22 15:36:11 +0900 | [diff] [blame] | 1153 | test_layer_properties_changed_notification(ctx); |
| 1154 | test_layer_create_notification(ctx); |
| 1155 | test_layer_remove_notification(ctx); |
Nobuhiko Tanibata | ffcc452 | 2015-06-22 15:37:41 +0900 | [diff] [blame] | 1156 | test_layer_bad_properties_changed_notification(ctx); |
| 1157 | test_surface_bad_configure_notification(ctx); |
| 1158 | test_layer_bad_create_notification(ctx); |
| 1159 | test_surface_bad_create_notification(ctx); |
| 1160 | test_layer_bad_remove_notification(ctx); |
| 1161 | test_surface_bad_remove_notification(ctx); |
Nobuhiko Tanibata | e78a7af | 2015-06-22 15:35:25 +0900 | [diff] [blame] | 1162 | |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 1163 | weston_compositor_exit_with_code(ctx->compositor, EXIT_SUCCESS); |
| 1164 | free(ctx); |
| 1165 | } |
| 1166 | |
| 1167 | int |
| 1168 | controller_module_init(struct weston_compositor *compositor, |
| 1169 | int *argc, char *argv[], |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1170 | const struct ivi_layout_interface *iface, |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 1171 | size_t iface_version); |
| 1172 | |
| 1173 | WL_EXPORT int |
| 1174 | controller_module_init(struct weston_compositor *compositor, |
| 1175 | int *argc, char *argv[], |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1176 | const struct ivi_layout_interface *iface, |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 1177 | size_t iface_version) |
| 1178 | { |
| 1179 | struct wl_event_loop *loop; |
| 1180 | struct test_context *ctx; |
| 1181 | |
| 1182 | /* strict check, since this is an internal test module */ |
| 1183 | if (iface_version != sizeof(*iface)) { |
| 1184 | weston_log("fatal: controller interface mismatch\n"); |
| 1185 | return -1; |
| 1186 | } |
| 1187 | |
| 1188 | ctx = zalloc(sizeof(*ctx)); |
| 1189 | if (!ctx) |
| 1190 | return -1; |
| 1191 | |
| 1192 | ctx->compositor = compositor; |
Ucan, Emre \(ADITG/SW1\) | 0c0e51e | 2015-10-15 14:51:41 +0000 | [diff] [blame] | 1193 | ctx->layout_interface = iface; |
Pekka Paalanen | 46804ca | 2015-03-27 11:55:21 +0200 | [diff] [blame] | 1194 | |
| 1195 | loop = wl_display_get_event_loop(compositor->wl_display); |
| 1196 | wl_event_loop_add_idle(loop, run_internal_tests, ctx); |
| 1197 | |
| 1198 | return 0; |
| 1199 | } |