bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d434bee31b5c7165eaecc1d93fb772acc564c95a
commit d434bee31b5c7165eaecc1d93fb772acc564c95a Author: Mike Blumenkrantz <[email protected]> Date: Tue Nov 26 10:59:21 2019 -0500 tests/layout: add explicit test for implicit theme,changed emission this must be emitted automatically during finalize if theme_set is not directly called during construction Reviewed-by: Marcel Hollerbach <[email protected]> Differential Revision: https://phab.enlightenment.org/D10741 --- src/tests/elementary/efl_ui_test_layout.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c index fc7a3b969c..387bf9aa68 100644 --- a/src/tests/elementary/efl_ui_test_layout.c +++ b/src/tests/elementary/efl_ui_test_layout.c @@ -149,6 +149,28 @@ EFL_START_TEST(efl_ui_layout_test_layout_force) } EFL_END_TEST +/* private */ +EAPI Eina_Bool elm_widget_theme_klass_set(Evas_Object *obj, const char *name); +EAPI Eina_Bool elm_widget_theme_style_set(Evas_Object *obj, const char *name); + +EFL_START_TEST(efl_ui_layout_test_callback) +{ + Evas_Object *win; + int called = 0; + Eina_Bool klass, style; + + win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); + efl_add(EFL_UI_LAYOUT_CLASS, win, + efl_event_callback_add(efl_added, EFL_UI_LAYOUT_EVENT_THEME_CHANGED, (void*)event_callback_single_call_int_data, &called), + klass = elm_widget_theme_klass_set(efl_added, "button"), + style = elm_widget_theme_style_set(efl_added, "anchor") + ); + ck_assert_int_eq(klass, 1); + ck_assert_int_eq(style, 1); + ck_assert_int_eq(called, 1); +} +EFL_END_TEST + EFL_START_TEST(efl_ui_layout_test_layout_theme) { Evas_Object *win; @@ -194,5 +216,6 @@ void efl_ui_test_layout(TCase *tc) tcase_add_test(tc, efl_ui_layout_test_layout_force); tcase_add_test(tc, efl_ui_layout_test_layout_theme); tcase_add_test(tc, efl_ui_layout_test_api_ordering); + tcase_add_test(tc, efl_ui_layout_test_callback); tcase_add_test(tc, efl_ui_layout_test_property_bind_provider); } --
