summaryrefslogtreecommitdiff
path: root/src/tests/ecore_wl2/ecore_wl2_test_window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/ecore_wl2/ecore_wl2_test_window.c')
-rw-r--r--src/tests/ecore_wl2/ecore_wl2_test_window.c322
1 files changed, 320 insertions, 2 deletions
diff --git a/src/tests/ecore_wl2/ecore_wl2_test_window.c b/src/tests/ecore_wl2/ecore_wl2_test_window.c
index 948def8..91c31f1 100644
--- a/src/tests/ecore_wl2/ecore_wl2_test_window.c
+++ b/src/tests/ecore_wl2/ecore_wl2_test_window.c
@@ -64,7 +64,7 @@ EFL_START_TEST(wl2_window_surface_test)
64} 64}
65EFL_END_TEST 65EFL_END_TEST
66 66
67EFL_START_TEST(wl2_window_rotation_get) 67EFL_START_TEST(wl2_window_rotation)
68{ 68{
69 Ecore_Wl2_Display *disp; 69 Ecore_Wl2_Display *disp;
70 Ecore_Wl2_Window *win; 70 Ecore_Wl2_Window *win;
@@ -78,6 +78,11 @@ EFL_START_TEST(wl2_window_rotation_get)
78 78
79 rot = ecore_wl2_window_rotation_get(win); 79 rot = ecore_wl2_window_rotation_get(win);
80 ck_assert_int_ge(rot, 0); 80 ck_assert_int_ge(rot, 0);
81
82 ecore_wl2_window_rotation_set(win, 90);
83
84 rot = ecore_wl2_window_rotation_get(win);
85 fail_if(rot != 90);
81} 86}
82EFL_END_TEST 87EFL_END_TEST
83 88
@@ -130,6 +135,304 @@ EFL_START_TEST(wl2_window_display_get)
130} 135}
131EFL_END_TEST 136EFL_END_TEST
132 137
138EFL_START_TEST(wl2_window_alpha)
139{
140 Ecore_Wl2_Display *disp;
141 Ecore_Wl2_Window *win;
142 Eina_Bool alpha = EINA_FALSE;
143
144 disp = _display_connect();
145 ck_assert(disp != NULL);
146
147 win = _window_create(disp);
148 ck_assert(win != NULL);
149
150 ecore_wl2_window_alpha_set(win, EINA_TRUE);
151
152 alpha = ecore_wl2_window_alpha_get(win);
153 fail_if(alpha != EINA_TRUE);
154}
155EFL_END_TEST
156
157EFL_START_TEST(wl2_window_floating_mode)
158{
159 Ecore_Wl2_Display *disp;
160 Ecore_Wl2_Window *win;
161 Eina_Bool f = EINA_FALSE;
162
163 disp = _display_connect();
164 ck_assert(disp != NULL);
165
166 win = _window_create(disp);
167 ck_assert(win != NULL);
168
169 ecore_wl2_window_floating_mode_set(win, EINA_TRUE);
170
171 f = ecore_wl2_window_floating_mode_get(win);
172 fail_if(f != EINA_TRUE);
173}
174EFL_END_TEST
175
176EFL_START_TEST(wl2_window_focus_skip)
177{
178 Ecore_Wl2_Display *disp;
179 Ecore_Wl2_Window *win;
180 Eina_Bool skip = EINA_FALSE;
181
182 disp = _display_connect();
183 ck_assert(disp != NULL);
184
185 win = _window_create(disp);
186 ck_assert(win != NULL);
187
188 ecore_wl2_window_focus_skip_set(win, EINA_TRUE);
189
190 skip = ecore_wl2_window_focus_skip_get(win);
191 fail_if(skip != EINA_TRUE);
192}
193EFL_END_TEST
194
195EFL_START_TEST(wl2_window_fullscreen)
196{
197 Ecore_Wl2_Display *disp;
198 Ecore_Wl2_Window *win;
199 Eina_Bool full = EINA_FALSE;
200
201 disp = _display_connect();
202 ck_assert(disp != NULL);
203
204 win = _window_create(disp);
205 ck_assert(win != NULL);
206
207 ecore_wl2_window_fullscreen_set(win, EINA_TRUE);
208
209 full = ecore_wl2_window_fullscreen_get(win);
210 fail_if(full != EINA_TRUE);
211}
212EFL_END_TEST
213
214EFL_START_TEST(wl2_window_maximize)
215{
216 Ecore_Wl2_Display *disp;
217 Ecore_Wl2_Window *win;
218 Eina_Bool m = EINA_FALSE;
219
220 disp = _display_connect();
221 ck_assert(disp != NULL);
222
223 win = _window_create(disp);
224 ck_assert(win != NULL);
225
226 ecore_wl2_window_maximized_set(win, EINA_TRUE);
227
228 m = ecore_wl2_window_maximized_get(win);
229 fail_if(m != EINA_TRUE);
230}
231EFL_END_TEST
232
233EFL_START_TEST(wl2_window_preferred_rot)
234{
235 Ecore_Wl2_Display *disp;
236 Ecore_Wl2_Window *win;
237 int rot = 0;
238
239 disp = _display_connect();
240 ck_assert(disp != NULL);
241
242 win = _window_create(disp);
243 ck_assert(win != NULL);
244
245 ecore_wl2_window_preferred_rotation_set(win, 90);
246
247 rot = ecore_wl2_window_preferred_rotation_get(win);
248 fail_if(rot != 90);
249}
250EFL_END_TEST
251
252EFL_START_TEST(wl2_window_rotation_app)
253{
254 Ecore_Wl2_Display *disp;
255 Ecore_Wl2_Window *win;
256 Eina_Bool r = EINA_FALSE;
257
258 disp = _display_connect();
259 ck_assert(disp != NULL);
260
261 win = _window_create(disp);
262 ck_assert(win != NULL);
263
264 ecore_wl2_window_rotation_app_set(win, EINA_TRUE);
265
266 r = ecore_wl2_window_rotation_app_get(win);
267 fail_if(r != EINA_TRUE);
268}
269EFL_END_TEST
270
271EFL_START_TEST(wl2_wm_window_rotation_app)
272{
273 Ecore_Wl2_Display *disp;
274 Ecore_Wl2_Window *win;
275 Eina_Bool r = EINA_FALSE;
276
277 disp = _display_connect();
278 ck_assert(disp != NULL);
279
280 win = _window_create(disp);
281 ck_assert(win != NULL);
282
283 ecore_wl2_window_wm_rotation_supported_set(win, EINA_TRUE);
284
285 r = ecore_wl2_window_wm_rotation_supported_get(win);
286 fail_if(r != EINA_TRUE);
287}
288EFL_END_TEST
289
290EFL_START_TEST(wl2_window_geometry)
291{
292 Ecore_Wl2_Display *disp;
293 Ecore_Wl2_Window *win;
294 int x, y, w, h;
295
296 disp = _display_connect();
297 ck_assert(disp != NULL);
298
299 win = _window_create(disp);
300 ck_assert(win != NULL);
301
302 ecore_wl2_window_geometry_set(win, 10, 10, 100, 100);
303
304 ecore_wl2_window_geometry_get(win, &x, &y, &w, &h);
305
306 fail_if(x != 10);
307 fail_if(y != 10);
308 fail_if(w != 100);
309 fail_if(h != 100);
310}
311EFL_END_TEST
312
313EFL_START_TEST(wl2_window_type)
314{
315 Ecore_Wl2_Display *disp;
316 Ecore_Wl2_Window *win;
317 Ecore_Wl2_Window_Type type = ECORE_WL2_WINDOW_TYPE_NONE;
318
319 disp = _display_connect();
320 ck_assert(disp != NULL);
321
322 win = _window_create(disp);
323 ck_assert(win != NULL);
324
325 ecore_wl2_window_type_set(win, ECORE_WL2_WINDOW_TYPE_TOPLEVEL);
326
327 type = ecore_wl2_window_type_get(win);
328 fail_if(type != ECORE_WL2_WINDOW_TYPE_TOPLEVEL);
329}
330EFL_END_TEST
331
332EFL_START_TEST(wl2_window_activated)
333{
334 Ecore_Wl2_Display *disp;
335 Ecore_Wl2_Window *win;
336 Eina_Bool ret;
337
338 disp = _display_connect();
339 ck_assert(disp != NULL);
340
341 win = _window_create(disp);
342 ck_assert(win != NULL);
343
344 ret = ecore_wl2_window_activated_get(win);
345
346 fail_if(ret != EINA_TRUE);
347}
348EFL_END_TEST
349
350EFL_START_TEST(wl2_window_aspect)
351{
352 Ecore_Wl2_Display *disp;
353 Ecore_Wl2_Window *win;
354 int w, h;
355 unsigned int aspect;
356
357 disp = _display_connect();
358 ck_assert(disp != NULL);
359
360 win = _window_create(disp);
361 ck_assert(win != NULL);
362
363 ecore_wl2_window_aspect_set(win, 1, 1, 3);
364 ecore_wl2_window_aspect_get(win, &w, &h, &aspect);
365
366 fail_if(w != 1);
367 fail_if(h != 1);
368 fail_if(aspect != 3);
369}
370EFL_END_TEST
371
372EFL_START_TEST(wl2_window_title)
373{
374 Ecore_Wl2_Display *disp;
375 Ecore_Wl2_Window *win;
376 const char *title;
377
378 disp = _display_connect();
379 ck_assert(disp != NULL);
380
381 win = _window_create(disp);
382 ck_assert(win != NULL);
383
384 ecore_wl2_window_title_set(win, "TEST");
385 title = ecore_wl2_window_title_get(win);
386
387 fail_if(strcmp(title, "TEST"));
388}
389EFL_END_TEST
390
391EFL_START_TEST(wl2_window_class)
392{
393 Ecore_Wl2_Display *disp;
394 Ecore_Wl2_Window *win;
395 const char *class;
396
397 disp = _display_connect();
398 ck_assert(disp != NULL);
399
400 win = _window_create(disp);
401 ck_assert(win != NULL);
402
403 ecore_wl2_window_class_set(win, "TEST");
404 class = ecore_wl2_window_class_get(win);
405
406 fail_if(strcmp(class, "TEST"));
407}
408EFL_END_TEST
409
410EFL_START_TEST(wl2_window_available_rotation)
411{
412 Ecore_Wl2_Display *disp;
413 Ecore_Wl2_Window *win;
414 Eina_Bool ret;
415 int rots[2] = { 90, 180 };
416 int *ret_rots;
417 unsigned int ret_count;
418
419 disp = _display_connect();
420 ck_assert(disp != NULL);
421
422 win = _window_create(disp);
423 ck_assert(win != NULL);
424
425 ecore_wl2_window_available_rotations_set(win, rots, 2);
426
427 ret = ecore_wl2_window_available_rotations_get(win, &ret_rots, &ret_count);
428
429 fail_if(ret != EINA_TRUE);
430 fail_if(ret_rots[0] != 90);
431 fail_if(ret_rots[1] != 180);
432 fail_if(ret_count != 2);
433}
434EFL_END_TEST
435
133void 436void
134ecore_wl2_test_window(TCase *tc) 437ecore_wl2_test_window(TCase *tc)
135{ 438{
@@ -138,10 +441,25 @@ ecore_wl2_test_window(TCase *tc)
138 /* window tests can only run if there is an existing compositor */ 441 /* window tests can only run if there is an existing compositor */
139 tcase_add_test(tc, wl2_window_new); 442 tcase_add_test(tc, wl2_window_new);
140 tcase_add_test(tc, wl2_window_surface_test); 443 tcase_add_test(tc, wl2_window_surface_test);
141 tcase_add_test(tc, wl2_window_rotation_get); 444 tcase_add_test(tc, wl2_window_rotation);
142 tcase_add_test(tc, wl2_window_output_find); 445 tcase_add_test(tc, wl2_window_output_find);
143 if (getenv("E_START")) 446 if (getenv("E_START"))
144 tcase_add_test(tc, wl2_window_aux_hints_supported_get); 447 tcase_add_test(tc, wl2_window_aux_hints_supported_get);
145 tcase_add_test(tc, wl2_window_display_get); 448 tcase_add_test(tc, wl2_window_display_get);
449 tcase_add_test(tc, wl2_window_alpha);
450 tcase_add_test(tc, wl2_window_floating_mode);
451 tcase_add_test(tc, wl2_window_focus_skip);
452 tcase_add_test(tc, wl2_window_fullscreen);
453 tcase_add_test(tc, wl2_window_maximize);
454 tcase_add_test(tc, wl2_window_preferred_rot);
455 tcase_add_test(tc, wl2_window_rotation_app);
456 tcase_add_test(tc, wl2_wm_window_rotation_app);
457 tcase_add_test(tc, wl2_window_geometry);
458 tcase_add_test(tc, wl2_window_type);
459 tcase_add_test(tc, wl2_window_activated);
460 tcase_add_test(tc, wl2_window_available_rotation);
461 tcase_add_test(tc, wl2_window_aspect);
462 tcase_add_test(tc, wl2_window_class);
463 tcase_add_test(tc, wl2_window_title);
146 } 464 }
147} 465}