summaryrefslogtreecommitdiff
path: root/src/tests/edje
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-24 10:18:01 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-26 11:41:58 +0100
commit1763afb391f550c22969b0706b1f4bcc1ffebfc3 (patch)
tree6d00f0a97c7cdd9d6a1506fcef05b919a7faffde /src/tests/edje
parent0b0ff33f2f097fb49665ec4576ccceb8ec0c9a8e (diff)
edje: implement container api
the container api returns the number of added swallows. the content iterator returns a iterator over all swallowed objects. The reason this is only for swallows is that the interface explicitly mentions UI elements at the count. Since i am believing the the result of the count operation should mirror to the amount of elements in the iterator, the iterator only returns swallowed objects. ref T5719 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7748
Diffstat (limited to 'src/tests/edje')
-rw-r--r--src/tests/edje/edje_test_swallow.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/tests/edje/edje_test_swallow.c b/src/tests/edje/edje_test_swallow.c
index bce0989..0d08951 100644
--- a/src/tests/edje/edje_test_swallow.c
+++ b/src/tests/edje/edje_test_swallow.c
@@ -123,6 +123,39 @@ EFL_START_TEST(edje_test_swallows_eoapi)
123} 123}
124EFL_END_TEST 124EFL_END_TEST
125 125
126EFL_START_TEST(edje_test_swallows_container_api)
127{
128 Evas *evas = _setup_evas();
129 Evas_Object *ly, *o1;
130
131 ly = efl_add(EFL_CANVAS_LAYOUT_CLASS, evas);
132 fail_unless(edje_object_file_set(ly, test_layout_get("test_swallows.edj"), "test_group"));
133
134 fail_unless(edje_object_part_exists(ly, "swallow"));
135
136 o1 = efl_add(EFL_CANVAS_LAYOUT_CLASS, ly);
137 fail_if(!efl_content_set(efl_part(ly, "swallow"), o1));
138
139 ck_assert_int_eq(efl_content_count(ly), 1);
140
141 {
142 Eina_Array *arr = eina_array_new(1);
143 Eina_Iterator *iter = efl_content_iterate(ly);
144 Eo *content;
145
146 EINA_ITERATOR_FOREACH(iter, content)
147 {
148 eina_array_push(arr, content);
149 }
150
151 ck_assert_int_eq(eina_array_count(arr), 1);
152 ck_assert_ptr_eq(eina_array_data_get(arr, 0), o1);
153 eina_array_free(arr);
154 }
155
156 evas_free(evas);
157}
158EFL_END_TEST
126 159
127void edje_test_swallow(TCase *tc) 160void edje_test_swallow(TCase *tc)
128{ 161{
@@ -130,4 +163,5 @@ void edje_test_swallow(TCase *tc)
130 tcase_add_test(tc, edje_test_swallows_lifetime); 163 tcase_add_test(tc, edje_test_swallows_lifetime);
131 tcase_add_test(tc, edje_test_swallows_invalidate); 164 tcase_add_test(tc, edje_test_swallows_invalidate);
132 tcase_add_test(tc, edje_test_swallows_eoapi); 165 tcase_add_test(tc, edje_test_swallows_eoapi);
166 tcase_add_test(tc, edje_test_swallows_container_api);
133} 167}