summaryrefslogtreecommitdiff
path: root/src/tests/edje/edje_test_edje.c
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/edje/edje_test_edje.c
parentd962705e4109860cc4dee83cebb0e432b8e69cb7 (diff)
Edje: Adapt to Efl.Container
This basically renames swallow into content.
Diffstat (limited to 'src/tests/edje/edje_test_edje.c')
-rw-r--r--src/tests/edje/edje_test_edje.c40
1 files changed, 36 insertions, 4 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}