From: Tom Hacohen Date: Wed, 20 Aug 2014 14:46:22 +0000 (+0100) Subject: Evas textblock: Add a test for multiline ellipsis. X-Git-Tag: upstream/1.11.0+73+gfce1e61~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f3ab0db3473f2d609058a13c76f187680df6790;p=platform%2Fupstream%2Fefl.git Evas textblock: Add a test for multiline ellipsis. This tests that even with multiline ellipsis, the ellipsis in the second line is not overdone (i.e it only does ellipsis as needed). This is a test for something we found out when we applied D1311 (for T1213). --- diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index e7d8cc9..c740be2 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -1752,6 +1752,10 @@ START_TEST(evas_textblock_wrapping) /* Ellipsis */ + int ellip_w = 0; + evas_object_textblock_text_markup_set(tb, "…"); + evas_object_textblock_size_native_get(tb, &ellip_w, NULL); + evas_object_textblock_text_markup_set(tb, "aaaaaaaaaaaaaaaaaa
b"); evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0 wrap=word"); evas_object_textblock_size_native_get(tb, &nw, &nh); @@ -1801,6 +1805,19 @@ START_TEST(evas_textblock_wrapping) } } + evas_object_textblock_text_markup_set(tb, "aaaaaaaaaaaaaaaaaa"); + evas_object_textblock_size_native_get(tb, &nw, &nh); + + evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0 wrap=char"); + nw /= 3; + nh *= 2; + evas_object_resize(tb, nw, nh); + + { + evas_object_textblock_line_number_geometry_get(tb, 1, NULL, NULL, &w, NULL); + ck_assert_int_gt(w, ellip_w); + } + /* Word wrap ending with whites. */ evas_object_resize(tb, 322, 400); evas_object_textblock_text_markup_set(tb, "This is an example text that should break at the end aaa ");