summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-24 18:58:50 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-29 08:26:06 +0100
commitb54035213f185e614ecf2d0793954efc383b45b8 (patch)
tree5f5f0095b124b96425196f8827c7326cd3948634 /src/tests
parentf66b3edc4d191856427e8553cb9e49f81f44f6b1 (diff)
efl_ui_widget: reintroduce legacy behaviour
before the refactoring of the disabled property, there was no way to enable a widget which has a disabled tree. This here however enables this to work again like this. The user will be told with an error message. The integraty of the property is maintained accross reparents. Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com> Differential Revision: https://phab.enlightenment.org/D8459
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/efl_ui_test_widget.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/tests/elementary/efl_ui_test_widget.c b/src/tests/elementary/efl_ui_test_widget.c
index bf75b0e012..aa9929978d 100644
--- a/src/tests/elementary/efl_ui_test_widget.c
+++ b/src/tests/elementary/efl_ui_test_widget.c
@@ -285,6 +285,42 @@ EFL_START_TEST(efl_ui_test_widget_disabled_parent)
285} 285}
286EFL_END_TEST 286EFL_END_TEST
287 287
288EFL_START_TEST(efl_ui_test_widget_disabled_behaviour)
289{
290 Efl_Ui_Win *win, *w1, *w2, *t;
291
292 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
293 efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
294 efl_text_set(efl_added, "Hello World"));
295 //first check the initial state
296 w1 = efl_add(efl_ui_widget_realized_class_get(), win);
297 efl_ui_widget_disabled_set(w1, EINA_TRUE);
298 w2 = efl_add(efl_ui_widget_realized_class_get(), win);
299 efl_ui_widget_disabled_set(w2, EINA_FALSE);
300
301
302 t = efl_add(efl_ui_widget_realized_class_get(), win);
303 efl_ui_widget_sub_object_add(w1, t);
304 //check that we never enable something under disabled parent
305 DISABLE_ABORT_ON_CRITICAL_START;
306 efl_ui_widget_disabled_set(t, EINA_FALSE);
307 DISABLE_ABORT_ON_CRITICAL_END;
308 ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE);
309 efl_del(t);
310
311 t = efl_add(efl_ui_widget_realized_class_get(), win);
312 efl_ui_widget_sub_object_add(w1, t);
313 //check that we can disable something with a disabled tree
314 efl_ui_widget_disabled_set(t, EINA_TRUE);
315 ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE);
316 efl_ui_widget_sub_object_add(w2, t);
317 ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE);
318 efl_del(t);
319
320 efl_del(win);
321}
322EFL_END_TEST
323
288static int tree_abort; 324static int tree_abort;
289static int tree_abort_level; 325static int tree_abort_level;
290 326
@@ -316,4 +352,5 @@ void efl_ui_test_widget(TCase *tc)
316 tcase_add_test(tc, efl_ui_test_widget_sub_object_theme_sync); 352 tcase_add_test(tc, efl_ui_test_widget_sub_object_theme_sync);
317 tcase_add_test(tc, efl_ui_test_widget_parent_relation); 353 tcase_add_test(tc, efl_ui_test_widget_parent_relation);
318 tcase_add_test(tc, efl_ui_test_widget_disabled_parent); 354 tcase_add_test(tc, efl_ui_test_widget_disabled_parent);
355 tcase_add_test(tc, efl_ui_test_widget_disabled_behaviour);
319} 356}