}
EFL_END_TEST
+EFL_START_TEST(efl_ui_test_widget_parent_relation)
+{
+ Efl_Ui_Win *win, *w1, *w2, *w3;
+
+ win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
+ efl_text_set(efl_added, "Hello World"));
+ //first check the initial state
+ w1 = efl_add(efl_ui_widget_realized_class_get(), win);
+ ck_assert_ptr_eq(efl_ui_widget_parent_get(w1), win);
+ w2 = efl_add(efl_ui_widget_realized_class_get(), w1);
+ ck_assert_ptr_eq(efl_ui_widget_parent_get(w2), w1);
+ w3 = efl_add(efl_ui_widget_realized_class_get(), w1);
+ ck_assert_ptr_eq(efl_ui_widget_parent_get(w3), w1);
+
+ //check if widget_parent is working correctly
+ efl_ui_widget_sub_object_add(w2, w3);
+ ck_assert_ptr_eq(efl_ui_widget_parent_get(w3), w2);
+
+ efl_del(win);
+}
+EFL_END_TEST
+
+
+EFL_START_TEST(efl_ui_test_widget_disabled_parent)
+{
+ Efl_Ui_Win *win, *w1, *w2, *t;
+
+ win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
+ efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
+ efl_text_set(efl_added, "Hello World"));
+ //first check the initial state
+ w1 = efl_add(efl_ui_widget_realized_class_get(), win);
+ efl_ui_widget_disabled_set(w1, EINA_TRUE);
+ w2 = efl_add(efl_ui_widget_realized_class_get(), win);
+ efl_ui_widget_disabled_set(w2, EINA_FALSE);
+ ck_assert_int_eq(efl_ui_widget_disabled_get(w1), EINA_TRUE);
+ ck_assert_int_eq(efl_ui_widget_disabled_get(w2), EINA_FALSE);
+
+ //check if disalbed gets correctly setted on reparent
+ t = efl_add(efl_ui_widget_realized_class_get(), win);
+ efl_ui_widget_sub_object_add(w2, t);
+ ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_FALSE);
+ efl_ui_widget_sub_object_add(w1, t);
+ ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE);
+ efl_del(t);
+
+ t = efl_add(efl_ui_widget_realized_class_get(), w2);
+ ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_FALSE);
+ efl_del(t);
+
+ t = efl_add(efl_ui_widget_realized_class_get(), w1);
+ ck_assert_int_eq(efl_ui_widget_disabled_get(t), EINA_TRUE);
+ efl_del(t);
+
+
+ efl_del(win);
+}
+EFL_END_TEST
+
static int tree_abort;
static int tree_abort_level;
tcase_add_test(tc, efl_ui_test_widget_sub_iterator);
tcase_add_test(tc, efl_ui_test_widget_sub_object_add_del);
tcase_add_test(tc, efl_ui_test_widget_sub_object_theme_sync);
+ tcase_add_test(tc, efl_ui_test_widget_parent_relation);
+ tcase_add_test(tc, efl_ui_test_widget_disabled_parent);
}