summaryrefslogtreecommitdiff
path: root/src/tests/edje
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2018-06-22 12:15:11 +0300
committerDaniel Hirt <hirt.danny@gmail.com>2018-06-22 12:30:59 +0300
commit69b5d67367b8ae16d6e98734d2b07e40725d4a0f (patch)
tree47d8b0fb4fe5ccfe82ee2816125829db9f6ef76a /src/tests/edje
parent59c2f78d79dab5096300263c616cbd61fde00ab9 (diff)
edje: fix text set/get issue without edje calculation
Summary: Some changes broke really basical function behavior of text. I couldn't get text from an edje object which I just set to the given edje object. In the past code, edje called recalc function before trying to get text. So, this patch bring that code to fix this issue. @fix Test Plan: Included. Run "make check" Reviewers: herdsman, raster, cedric, woohyun, devilhorns Subscribers: #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6364
Diffstat (limited to 'src/tests/edje')
-rw-r--r--src/tests/edje/data/test_textblock.edc20
-rw-r--r--src/tests/edje/edje_test_edje.c20
2 files changed, 40 insertions, 0 deletions
diff --git a/src/tests/edje/data/test_textblock.edc b/src/tests/edje/data/test_textblock.edc
new file mode 100644
index 0000000..e3569a6
--- /dev/null
+++ b/src/tests/edje/data/test_textblock.edc
@@ -0,0 +1,20 @@
1collections {
2 styles {
3 style { name: "tb_style";
4 base: "font=Sans font_size=20 color=#fff";
5 }
6 }
7 group { name: "test_textblock";
8 parts {
9 part { name: "text";
10 type: TEXTBLOCK;
11 description { state: "default" 0.0;
12 min: 300 300;
13 text {
14 style: "tb_style";
15 }
16 }
17 }
18 }
19 }
20}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index 3a39bec..0f98e3c 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -1072,6 +1072,25 @@ EFL_START_TEST(edje_test_part_caching)
1072} 1072}
1073EFL_END_TEST 1073EFL_END_TEST
1074 1074
1075EFL_START_TEST(edje_test_textblock)
1076{
1077 Evas *evas;
1078 Evas_Object *obj;
1079 const char *buf = "Hello";
1080 const char *txt;
1081
1082 evas = EDJE_TEST_INIT_EVAS();
1083
1084 obj = edje_object_add(evas);
1085 fail_unless(edje_object_file_set(obj, test_layout_get("test_textblock.edj"), "test_textblock"));
1086 edje_object_part_text_set(obj, "text", buf);
1087 txt = edje_object_part_text_get(obj, "text");
1088 fail_if(!txt || strcmp(txt, buf));
1089
1090 EDJE_TEST_FREE_EVAS();
1091}
1092EFL_END_TEST
1093
1075void edje_test_edje(TCase *tc) 1094void edje_test_edje(TCase *tc)
1076{ 1095{
1077 tcase_add_test(tc, edje_test_edje_init); 1096 tcase_add_test(tc, edje_test_edje_init);
@@ -1100,4 +1119,5 @@ void edje_test_edje(TCase *tc)
1100 tcase_add_test(tc, edje_test_signal_callback_del_full); 1119 tcase_add_test(tc, edje_test_signal_callback_del_full);
1101 tcase_add_test(tc, edje_test_text_cursor); 1120 tcase_add_test(tc, edje_test_text_cursor);
1102 tcase_add_test(tc, edje_test_part_caching); 1121 tcase_add_test(tc, edje_test_part_caching);
1122 tcase_add_test(tc, edje_test_textblock);
1103} 1123}