aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel@osg.samsung.com>2017-11-15 10:15:34 +0100
committerMarcel Hollerbach <marcel@osg.samsung.com>2017-11-15 13:21:22 +0100
commitde084292e06e011afb4e86134b25eb34041ba58b (patch)
treea475a301f307727bb17c6c6c76155c65850772cf /src/tests
parentefl_ui_focus_manager_calc: correct handle focus when redirects are set (diff)
downloadefl-de084292e06e011afb4e86134b25eb34041ba58b.tar.gz
efl_ui_focus_manager: unset the redirect chain once a redirect is set
this prevents the manager from having a redirect chain while not even beeing used by the root manager
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/elm_test_focus.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_focus.c b/src/tests/elementary/elm_test_focus.c
index e7b4676342..385b8fbcc0 100644
--- a/src/tests/elementary/elm_test_focus.c
+++ b/src/tests/elementary/elm_test_focus.c
@@ -396,6 +396,51 @@ START_TEST(root_redirect_chain)
}
END_TEST
+START_TEST(root_redirect_chain_unset)
+{
+ Efl_Ui_Focus_Manager *m, *m2, *m3, *m4;
+
+ elm_init(1, NULL);
+
+ TEST_OBJ_NEW(root, 0, 20, 20, 20);
+ TEST_OBJ_NEW(root2, 0, 20, 20, 20);
+ TEST_OBJ_NEW(child, 0, 20, 20, 20);
+
+ m = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ efl_ui_focus_manager_root_set(efl_added, root)
+ );
+
+ focus_test_manager_set(root2, m);
+
+ m2 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ efl_ui_focus_manager_root_set(efl_added, root2)
+ );
+
+ m3 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ efl_ui_focus_manager_root_set(efl_added, root2)
+ );
+
+ m4 = efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, NULL,
+ efl_ui_focus_manager_root_set(efl_added, root2)
+ );
+
+ efl_ui_focus_manager_redirect_set(m, m3);
+ efl_ui_focus_manager_redirect_set(m3, m4);
+ efl_ui_focus_manager_redirect_set(m4, m2);
+
+ efl_ui_focus_manager_calc_register(m, root2, root, m2);
+ efl_ui_focus_manager_calc_register(m2, child, root2, NULL);
+ efl_ui_focus_manager_focus_set(m2, child);
+
+ ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m), m2);
+ ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m2), NULL);
+ ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m3), NULL);
+ ck_assert_ptr_eq(efl_ui_focus_manager_redirect_get(m4), NULL);
+
+ elm_shutdown();
+}
+END_TEST
+
void elm_test_focus(TCase *tc)
{
tcase_add_test(tc, focus_register_twice);
@@ -410,4 +455,5 @@ void elm_test_focus(TCase *tc)
tcase_add_test(tc, order_check);
tcase_add_test(tc, logical_shift);
tcase_add_test(tc, root_redirect_chain);
+ tcase_add_test(tc, root_redirect_chain_unset);
}