summaryrefslogtreecommitdiff
path: root/src/tests/evas
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2020-08-05 13:09:00 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-08-05 13:09:00 +0900
commited18471ba955be316abb2117ebdde3f3df418751 (patch)
treeb9310cb76fdd1d6b16607b08d2434d96522be6bd /src/tests/evas
parent45c6212d2078ce33f2966b3dca698a97ad51b9f9 (diff)
evas_textblock: enhance cursor event submitting during markup_set/text_set
Summary: Enhance text cursor events submitting: 1- Submit events only for changed cursors. 2- Reduce code complexity for cursor change. 3- Add test case for cursor event change Reviewers: woohyun, zmike, bu5hm4n Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11775
Diffstat (limited to 'src/tests/evas')
-rw-r--r--src/tests/evas/evas_test_textblock.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index 707c72f22c..6bdf25a19d 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4847,6 +4847,26 @@ EFL_START_TEST(efl_canvas_textblock_cursor)
4847} 4847}
4848EFL_END_TEST 4848EFL_END_TEST
4849 4849
4850EFL_START_TEST(efl_canvas_textblock_cursor_change)
4851{
4852 START_EFL_CANVAS_TEXTBLOCK_TEST();
4853 (void) cur_obj;
4854 int changed_emit1 = 0;
4855 int changed_emit2 = 0;
4856 Efl_Object *cur1, *cur2;
4857 cur1 = efl_canvas_textblock_cursor_create(txt);
4858 cur2 = efl_canvas_textblock_cursor_create(txt);
4859 efl_text_set(txt, "Hello World");
4860 efl_text_cursor_object_position_set(cur1, 0);
4861 efl_text_cursor_object_position_set(cur2, 1);
4862 efl_event_callback_add(cur1, EFL_TEXT_CURSOR_OBJECT_EVENT_CHANGED, _increment_int_changed, &changed_emit1);
4863 efl_event_callback_add(cur2, EFL_TEXT_CURSOR_OBJECT_EVENT_CHANGED, _increment_int_changed, &changed_emit2);
4864 efl_text_set(txt, "");
4865 ck_assert_int_eq(changed_emit1, 0);
4866 ck_assert_int_eq(changed_emit2, 1);
4867}
4868EFL_END_TEST
4869
4850 4870
4851EFL_START_TEST(efl_canvas_textblock_markup) 4871EFL_START_TEST(efl_canvas_textblock_markup)
4852{ 4872{
@@ -5143,6 +5163,7 @@ void evas_test_textblock(TCase *tc)
5143 tcase_add_test(tc, efl_canvas_textblock_simple); 5163 tcase_add_test(tc, efl_canvas_textblock_simple);
5144 tcase_add_test(tc, efl_text); 5164 tcase_add_test(tc, efl_text);
5145 tcase_add_test(tc, efl_canvas_textblock_cursor); 5165 tcase_add_test(tc, efl_canvas_textblock_cursor);
5166 tcase_add_test(tc, efl_canvas_textblock_cursor_change);
5146 tcase_add_test(tc, efl_canvas_textblock_markup); 5167 tcase_add_test(tc, efl_canvas_textblock_markup);
5147 tcase_add_test(tc, efl_canvas_textblock_markup_invalid_escape); 5168 tcase_add_test(tc, efl_canvas_textblock_markup_invalid_escape);
5148 tcase_add_test(tc, efl_text_font); 5169 tcase_add_test(tc, efl_text_font);