summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_test_gengrid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/elementary/elm_test_gengrid.c')
-rw-r--r--src/tests/elementary/elm_test_gengrid.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_gengrid.c b/src/tests/elementary/elm_test_gengrid.c
index 87efc61..77a4eb4 100644
--- a/src/tests/elementary/elm_test_gengrid.c
+++ b/src/tests/elementary/elm_test_gengrid.c
@@ -153,11 +153,62 @@ EFL_START_TEST(elm_gengrid_focus)
153} 153}
154EFL_END_TEST 154EFL_END_TEST
155 155
156static void
157_gengrid_item_content_test_realize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
158{
159 ecore_main_loop_quit();
160}
161
162static Evas_Object *
163_item_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED)
164{
165 Evas_Object *ic = elm_button_add(obj);
166 return ic;
167}
168
169EFL_START_TEST(elm_gengrid_item_content)
170{
171 Evas_Object *win, *gengrid;
172 Elm_Genlist_Item_Class *gtc;
173 Evas_Object *content, *parent;
174 Elm_Object_Item *it;
175
176 gtc = elm_gengrid_item_class_new();
177 gtc->item_style = "default";
178 gtc->func.content_get = _item_content_get;
179 gtc->func.state_get = NULL;
180 gtc->func.del = NULL;
181
182 win = win_add(NULL, "gengrid", ELM_WIN_BASIC);
183
184 gengrid = elm_gengrid_add(win);
185 evas_object_smart_callback_add(gengrid, "realized", _gengrid_item_content_test_realize, NULL);
186
187 it = elm_gengrid_item_append(gengrid, gtc, NULL, NULL, NULL);
188
189 evas_object_resize(gengrid, 100, 100);
190 evas_object_resize(win, 150, 150);
191 evas_object_show(gengrid);
192 evas_object_show(win);
193
194 ecore_main_loop_begin();
195
196 content = elm_object_item_part_content_get(it, "elm.swallow.end");
197 parent = elm_object_parent_widget_get(content);
198 ck_assert_ptr_eq(parent, gengrid);
199
200 elm_gengrid_item_all_contents_unset(it, NULL);
201 parent = elm_object_parent_widget_get(content);
202 ck_assert_ptr_eq(parent, win);
203}
204EFL_END_TEST
205
156void elm_test_gengrid(TCase *tc) 206void elm_test_gengrid(TCase *tc)
157{ 207{
158 tcase_add_test(tc, elm_gengrid_legacy_type_check); 208 tcase_add_test(tc, elm_gengrid_legacy_type_check);
159 tcase_add_test(tc, elm_atspi_role_get); 209 tcase_add_test(tc, elm_atspi_role_get);
160 tcase_add_test(tc, elm_gengrid_focus); 210 tcase_add_test(tc, elm_gengrid_focus);
211 tcase_add_test(tc, elm_gengrid_item_content);
161#if 0 212#if 0
162 tcase_add_test(tc, elm_atspi_children_parent); 213 tcase_add_test(tc, elm_atspi_children_parent);
163#endif 214#endif