summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-04-03 11:50:19 -0400
committerStefan Schmidt <s.schmidt@samsung.com>2020-04-16 14:34:07 +0200
commit2797827e6b60a640a7ae2c4059445d657c5a79ac (patch)
treeaf2d036bfc98cf904818ec3cff9c1e2f77194e5d
parent27f55105334f9d48d8c647610331915cbc4d89dc (diff)
tests/elm: add hoversel test to verify edge of canvas positioning
ensure that T8642 doesn't reoccur Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11647
-rw-r--r--src/tests/elementary/elm_test_hoversel.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_test_hoversel.c b/src/tests/elementary/elm_test_hoversel.c
index 0ccc5834da..58b18b94ce 100644
--- a/src/tests/elementary/elm_test_hoversel.c
+++ b/src/tests/elementary/elm_test_hoversel.c
@@ -108,9 +108,49 @@ EFL_START_TEST(elm_test_hoversel_behavior)
108} 108}
109EFL_END_TEST 109EFL_END_TEST
110 110
111EFL_START_TEST(elm_test_hoversel_position)
112{
113 Eo *hoversel, *win = win_add();
114
115 evas_object_resize(win, 500, 500);
116 hoversel = elm_hoversel_add(win);
117 evas_object_geometry_set(hoversel, 450, 450, 50, 50);
118 elm_hoversel_hover_parent_set(hoversel, win);
119 elm_object_text_set(hoversel, "Vertical");
120 elm_hoversel_item_add(hoversel, "Item 1", NULL, ELM_ICON_NONE, NULL, NULL);
121 elm_hoversel_item_add(hoversel, "Item 2", NULL, ELM_ICON_NONE, NULL, NULL);
122 elm_hoversel_item_add(hoversel, "Item 3", NULL, ELM_ICON_NONE, NULL, NULL);
123 elm_hoversel_item_add(hoversel, "Item 4 - Long Label Here", "close", ELM_ICON_STANDARD, NULL, NULL);
124
125 evas_object_show(win);
126 evas_object_show(hoversel);
127 elm_object_focus_set(hoversel, EINA_TRUE);
128
129 get_me_to_those_events(win);
130 assert_object_size_eq(hoversel, 50, 50);
131 click_object(hoversel);
132 get_me_to_those_events(win);
133
134 wait_timer(0.6); // from default theme
135 ecore_main_loop_iterate();
136
137 ELM_HOVERSEL_DATA_GET(hoversel, sd);
138 {
139 int x, y, w, h;
140 Eo *item = eina_list_data_get(elm_box_children_get(sd->bx));
141 evas_object_geometry_get(item, &x, &y, &w, &h);
142
143 /* verify that all buttons are in-canvas */
144 ck_assert_int_le(x + w, 500);
145 ck_assert_int_le(y + h, 500);
146 }
147}
148EFL_END_TEST
149
111void elm_test_hoversel(TCase *tc) 150void elm_test_hoversel(TCase *tc)
112{ 151{
113 tcase_add_test(tc, elm_hoversel_legacy_type_check); 152 tcase_add_test(tc, elm_hoversel_legacy_type_check);
114 tcase_add_test(tc, elm_atspi_role_get); 153 tcase_add_test(tc, elm_atspi_role_get);
115 tcase_add_test(tc, elm_test_hoversel_behavior); 154 tcase_add_test(tc, elm_test_hoversel_behavior);
155 tcase_add_test(tc, elm_test_hoversel_position);
116} 156}