summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-04-21 12:04:13 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-04-26 11:36:23 +0900
commite1092b84eb9a196aa2cdc00dd49c1e8af9dd5a36 (patch)
tree0aed3afbf542deb8ce20e62088483ebeed32ed34 /src/tests
parentd962705e4109860cc4dee83cebb0e432b8e69cb7 (diff)
Edje: Adapt to Efl.Container
This basically renames swallow into content.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/edje/edje_test_edje.c40
-rw-r--r--src/tests/emotion/emotion_test_main-eo.c8
2 files changed, 40 insertions, 8 deletions
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index a576ac3068..50fdcac3f6 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -362,17 +362,48 @@ START_TEST(edje_test_swallows)
362 362
363 363
364 o1 = eo_add(EDJE_OBJECT_CLASS, ly); 364 o1 = eo_add(EDJE_OBJECT_CLASS, ly);
365 fail_if(!edje_obj_part_swallow(ly, "swallow", o1)); 365 fail_if(!edje_object_part_swallow(ly, "swallow", o1));
366 ck_assert_ptr_eq(eo_parent_get(o1), ly); 366 ck_assert_ptr_eq(eo_parent_get(o1), ly);
367 367
368 edje_obj_part_unswallow(ly, o1); 368 edje_object_part_unswallow(ly, o1);
369 ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1)); 369 ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1));
370 370
371 fail_if(!edje_obj_part_swallow(ly, "swallow", o1)); 371 fail_if(!edje_object_part_swallow(ly, "swallow", o1));
372 ck_assert_ptr_eq(eo_parent_get(o1), ly); 372 ck_assert_ptr_eq(eo_parent_get(o1), ly);
373 373
374 o2 = eo_add(EDJE_OBJECT_CLASS, ly); 374 o2 = eo_add(EDJE_OBJECT_CLASS, ly);
375 fail_if(!edje_obj_part_swallow(ly, "swallow", o2)); 375 fail_if(!edje_object_part_swallow(ly, "swallow", o2));
376 ck_assert_ptr_eq(eo_parent_get(o2), ly);
377 /* o1 is deleted at this point. */
378 ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1));
379
380 EDJE_TEST_FREE_EVAS();
381}
382END_TEST
383
384START_TEST(edje_test_swallows_eoapi)
385{
386 Evas *evas = EDJE_TEST_INIT_EVAS();
387 Evas_Object *ly, *o1, *o2;
388
389 ly = eo_add(EDJE_OBJECT_CLASS, evas);
390 fail_unless(edje_object_file_set(ly, test_layout_get("test_swallows.edj"), "test_group"));
391
392 fail_unless(edje_object_part_exists(ly, "swallow"));
393
394
395 o1 = eo_add(EDJE_OBJECT_CLASS, ly);
396 fail_if(!efl_content_set(ly, "swallow", o1));
397 ck_assert_ptr_eq(eo_parent_get(o1), ly);
398
399 efl_content_remove(ly, o1);
400 ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1));
401
402 fail_if(!efl_content_set(ly, "swallow", o1));
403 ck_assert_ptr_eq(eo_parent_get(o1), ly);
404
405 o2 = eo_add(EDJE_OBJECT_CLASS, ly);
406 fail_if(!efl_content_set(ly, "swallow", o2));
376 ck_assert_ptr_eq(eo_parent_get(o2), ly); 407 ck_assert_ptr_eq(eo_parent_get(o2), ly);
377 /* o1 is deleted at this point. */ 408 /* o1 is deleted at this point. */
378 ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1)); 409 ck_assert_ptr_eq(eo_parent_get(o1), evas_common_evas_get(o1));
@@ -434,5 +465,6 @@ void edje_test_edje(TCase *tc)
434 tcase_add_test(tc, edje_test_size_class); 465 tcase_add_test(tc, edje_test_size_class);
435 tcase_add_test(tc, edje_test_color_class); 466 tcase_add_test(tc, edje_test_color_class);
436 tcase_add_test(tc, edje_test_swallows); 467 tcase_add_test(tc, edje_test_swallows);
468 tcase_add_test(tc, edje_test_swallows_eoapi);
437 tcase_add_test(tc, edje_test_box); 469 tcase_add_test(tc, edje_test_box);
438} 470}
diff --git a/src/tests/emotion/emotion_test_main-eo.c b/src/tests/emotion/emotion_test_main-eo.c
index 8a8aad5659..c1d55a571d 100644
--- a/src/tests/emotion/emotion_test_main-eo.c
+++ b/src/tests/emotion/emotion_test_main-eo.c
@@ -353,11 +353,11 @@ video_obj_frame_resize_cb(void *data, const Eo_Event *event)
353 printf("HANDLE %ix%i @ %3.3f\n", iw, ih, ratio); 353 printf("HANDLE %ix%i @ %3.3f\n", iw, ih, ratio);
354 if (ratio > 0.0) iw = (ih * ratio) + 0.5; 354 if (ratio > 0.0) iw = (ih * ratio) + 0.5;
355 evas_object_size_hint_min_set(event->obj, iw, ih); 355 evas_object_size_hint_min_set(event->obj, iw, ih);
356 edje_obj_part_swallow(oe, "video_swallow", event->obj); 356 edje_object_part_swallow(oe, "video_swallow", event->obj);
357 edje_obj_size_min_calc(oe, &w, &h); 357 edje_obj_size_min_calc(oe, &w, &h);
358 efl_gfx_size_set(oe, w, h); 358 efl_gfx_size_set(oe, w, h);
359 evas_obj_size_hint_min_set(event->obj, 0, 0); 359 evas_object_size_hint_min_set(event->obj, 0, 0);
360 edje_obj_part_swallow(oe, "video_swallow", event->obj); 360 edje_object_part_swallow(oe, "video_swallow", event->obj);
361 361
362 return EINA_TRUE; 362 return EINA_TRUE;
363} 363}
@@ -643,7 +643,7 @@ init_video_object(const char *module_filename, const char *filename)
643 eo_event_callback_add(oe, EVAS_OBJECT_EVENT_FREE, _oe_free_cb, fd); 643 eo_event_callback_add(oe, EVAS_OBJECT_EVENT_FREE, _oe_free_cb, fd);
644 eo_key_data_set(oe, "frame_data", fd); 644 eo_key_data_set(oe, "frame_data", fd);
645 efl_file_set(oe, theme_file, reflex ? "video_controller/reflex" : "video_controller"); 645 efl_file_set(oe, theme_file, reflex ? "video_controller/reflex" : "video_controller");
646 edje_obj_part_swallow(oe, "video_swallow", o); 646 edje_object_part_swallow(oe, "video_swallow", o);
647 647
648 offset = 20 * (eina_list_count(video_objs) - 1); 648 offset = 20 * (eina_list_count(video_objs) - 1);
649 efl_gfx_position_set(oe, offset, offset); 649 efl_gfx_position_set(oe, offset, offset);