summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-13 10:14:37 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-09-13 10:14:59 -0400
commitbc8c432841c50278bca2a7d118fbb3f14a800cab (patch)
tree6e8cfb9e17c05754757ebe57ba09bae543dfe828 /src/tests
parent6bac60262e859a5ff5de6eed9ca0d596262d9537 (diff)
efl_ui_slider: correct to a multiple of step when drag is finished
Summary: this is needed in order to support the value to be a multiple of the step when drag has finished. The normal changed event is still emitted with non-multiple of step, but the steady event only contains the correct values now. ref T8187 Reviewers: zmike, segfaultxavi, woohyun Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8187 Differential Revision: https://phab.enlightenment.org/D9928
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/efl_ui_test_slider.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/tests/elementary/efl_ui_test_slider.c b/src/tests/elementary/efl_ui_test_slider.c
index 6547ae406e..ac348a0e00 100644
--- a/src/tests/elementary/efl_ui_test_slider.c
+++ b/src/tests/elementary/efl_ui_test_slider.c
@@ -96,8 +96,46 @@ EFL_START_TEST(efl_ui_test_slider_step)
96 ck_assert_int_eq(efl_ui_range_value_get(slider), 10); 96 ck_assert_int_eq(efl_ui_range_value_get(slider), 10);
97} 97}
98EFL_END_TEST 98EFL_END_TEST
99
100EFL_START_TEST(efl_ui_test_slider_step_drag)
101{
102 Eo *slider;
103 Evas *e;
104 Eo *win = win_add();
105
106 efl_gfx_entity_size_set(win, EINA_SIZE2D(400, 100));
107 slider = efl_add(EFL_UI_SLIDER_CLASS, win,
108 efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(400, 100))
109 );
110 efl_ui_range_limits_set(slider, 0, 100);
111 efl_ui_range_step_set(slider, 10);
112 efl_ui_range_value_set(slider, 20);
113
114 e = evas_object_evas_get(win);
115
116 efl_layout_signal_process(slider, EINA_TRUE);
117 get_me_to_those_events(slider);
118
119
120 int x, y, w, h;
121 int sx, sy, sw, sh;
122
123 evas_object_geometry_get(elm_object_part_content_get(slider, "efl.bar"), &x, &y, &w, &h);
124 evas_object_geometry_get(slider, &sx, &sy, &sw, &sh);
125 evas_event_feed_mouse_in(e, 0, NULL);
126 evas_event_feed_mouse_down(e, 1, 0, 0, NULL);
127 evas_event_feed_mouse_move(e, x + (w / 4)*3, y + (h / 4)*3, 0, NULL);
128 evas_event_feed_mouse_move(e, x + (w / 2), y + (h / 2), 0, NULL);
129 evas_event_feed_mouse_move(e, x + (w / 4), y + (h / 4), 0, NULL);
130 evas_event_feed_mouse_up(e, 1, 0, 0, NULL);
131 efl_layout_signal_process(slider, EINA_TRUE);
132 ck_assert_int_eq(efl_ui_range_value_get(slider), 20);
133}
134EFL_END_TEST
135
99void efl_ui_test_slider(TCase *tc) 136void efl_ui_test_slider(TCase *tc)
100{ 137{
101 tcase_add_test(tc, efl_ui_test_slider_events); 138 tcase_add_test(tc, efl_ui_test_slider_events);
102 tcase_add_test(tc, efl_ui_test_slider_step); 139 tcase_add_test(tc, efl_ui_test_slider_step);
140 tcase_add_test(tc, efl_ui_test_slider_step_drag);
103} 141}