forked from enlightenment/efl
Elm layout: Add parent updating tests to elm layout.
This commit is contained in:
parent
1d7caffed5
commit
cd26435434
|
@ -1232,6 +1232,7 @@ tests_elementary_elm_suite_SOURCES = \
|
|||
tests_elementary_elm_suite_CPPFLAGS = \
|
||||
-DTESTS_BUILD_DIR=\"${top_builddir}/src/tests/elementary\" \
|
||||
-DELM_IMAGE_DATA_DIR=\"${top_srcdir}/data/elementary\" \
|
||||
-DELM_TEST_DATA_DIR=\"${abs_top_builddir}/data/elementary\" \
|
||||
-I$(top_srcdir)/src/lib/elementary \
|
||||
-I$(top_builddir)/src/lib/elementary \
|
||||
@CHECK_CFLAGS@ \
|
||||
|
|
|
@ -24,7 +24,41 @@ START_TEST(elm_atspi_role_get)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
START_TEST(elm_layout_swallows)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
Evas_Object *win, *ly, *bt, *bt2;
|
||||
|
||||
elm_init(1, NULL);
|
||||
win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
|
||||
|
||||
ly = eo_add(ELM_LAYOUT_CLASS, win);
|
||||
snprintf(buf, sizeof(buf), "%s/objects/test.edj", ELM_TEST_DATA_DIR);
|
||||
elm_layout_file_set(ly, buf, "layout");
|
||||
evas_object_show(ly);
|
||||
|
||||
bt = eo_add(ELM_BUTTON_CLASS, ly);
|
||||
fail_if(!elm_obj_container_content_set(ly, "element1", bt));
|
||||
ck_assert_ptr_eq(eo_parent_get(bt), ly);
|
||||
|
||||
bt = elm_obj_container_content_unset(ly, "element1");
|
||||
ck_assert_ptr_eq(eo_parent_get(bt), evas_common_evas_get(bt));
|
||||
|
||||
fail_if(!elm_obj_container_content_set(ly, "element1", bt));
|
||||
ck_assert_ptr_eq(eo_parent_get(bt), ly);
|
||||
|
||||
bt2 = eo_add(ELM_BUTTON_CLASS, ly);
|
||||
fail_if(!elm_obj_container_content_set(ly, "element1", bt2));
|
||||
ck_assert_ptr_eq(eo_parent_get(bt2), ly);
|
||||
/* bt is deleted at this point. */
|
||||
ck_assert_ptr_eq(eo_parent_get(bt), evas_common_evas_get(bt));
|
||||
|
||||
elm_shutdown();
|
||||
}
|
||||
END_TEST
|
||||
|
||||
void elm_test_layout(TCase *tc)
|
||||
{
|
||||
tcase_add_test(tc, elm_atspi_role_get);
|
||||
tcase_add_test(tc, elm_layout_swallows);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue