summaryrefslogtreecommitdiff
path: root/src/tests/edje
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-09-07 19:08:50 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-01 20:10:54 +0900
commit35fe059ec8091a7635117abfddb5ed3f83e2101e (patch)
tree235d727d5e92dcf89298baf5ced90fbadfbfddee /src/tests/edje
parent6ac4f7154b7750b7c9765f74428e2ebcc83290d9 (diff)
Edje: Add test case for SNAPSHOT
This is mostly an edje_cc compilation test.
Diffstat (limited to 'src/tests/edje')
-rw-r--r--src/tests/edje/data/test_snapshot.edc61
-rw-r--r--src/tests/edje/edje_test_edje.c25
2 files changed, 86 insertions, 0 deletions
diff --git a/src/tests/edje/data/test_snapshot.edc b/src/tests/edje/data/test_snapshot.edc
new file mode 100644
index 0000000000..a68c6491e8
--- /dev/null
+++ b/src/tests/edje/data/test_snapshot.edc
@@ -0,0 +1,61 @@
1collections {
2 filters {
3 filter {
4 name: "filter";
5 script {
6 padding_set(0)
7 blur { 10 }
8 }
9 }
10 }
11 images {
12 // found in tests/emotion/data
13 image: "e_logo.png" COMP;
14 }
15 group { name: "test_group";
16 filters {
17 filter.file: "filter.lua";
18 }
19 parts {
20 part { name: "background";
21 type: RECT;
22 description { state: "default" 0.0;
23 color: 33 32 32 255;
24 rel1.relative: 0 0;
25 rel2.relative: 1 1;
26 max: 250 250;
27 }
28 }
29 image { "img";
30 desc { "default";
31 image.normal: "e_logo.png";
32 fill.type: TILE;
33 rel.to: "background";
34 }
35 }
36 part { name: "snap";
37 type: SNAPSHOT;
38 desc { "default";
39 rel.to: "background";
40 rel1.relative: 0.25 0.25;
41 rel2.relative: 0.75 0.75;
42 filter.code: "filter";
43 }
44 desc { "hid"; inherit: "default"; hid;
45 }
46 }
47 }
48 programs.program {
49 source: "*";
50 signal: "mouse,in";
51 action: STATE_SET "hid" 0.0;
52 targets: "snap";
53 }
54 programs.program {
55 source: "*";
56 signal: "mouse,out";
57 action: STATE_SET "default" 0.0;
58 targets: "snap";
59 }
60 }
61}
diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c
index bf32f6d2e2..43eacdcc65 100644
--- a/src/tests/edje/edje_test_edje.c
+++ b/src/tests/edje/edje_test_edje.c
@@ -243,6 +243,30 @@ START_TEST(edje_test_filters)
243} 243}
244END_TEST 244END_TEST
245 245
246START_TEST(edje_test_snapshot)
247{
248 Evas *evas = EDJE_TEST_INIT_EVAS();
249 const Evas_Object *sub;
250 Evas_Object *obj, *src = NULL;
251 Eina_Bool b;
252
253 setenv("EVAS_DATA_DIR", EVAS_DATA_DIR, 1);
254
255 obj = edje_object_add(evas);
256 fail_unless(edje_object_file_set(obj, test_layout_get("test_snapshot.edj"), "test_group"));
257
258 evas_object_resize(obj, 200, 200);
259
260 /* check value of no_render flag as seen from evas land */
261 sub = edje_object_part_object_get(obj, "snap");
262 fail_if(!eo_do_ret(sub, b, evas_obj_image_snapshot_get()));
263
264 // TODO: Verify that evas snapshot actually works (and has a filter)
265
266 EDJE_TEST_FREE_EVAS();
267}
268END_TEST
269
246void edje_test_edje(TCase *tc) 270void edje_test_edje(TCase *tc)
247{ 271{
248 tcase_add_test(tc, edje_test_edje_init); 272 tcase_add_test(tc, edje_test_edje_init);
@@ -253,4 +277,5 @@ void edje_test_edje(TCase *tc)
253 tcase_add_test(tc, edje_test_calculate_parens); 277 tcase_add_test(tc, edje_test_calculate_parens);
254 tcase_add_test(tc, edje_test_masking); 278 tcase_add_test(tc, edje_test_masking);
255 tcase_add_test(tc, edje_test_filters); 279 tcase_add_test(tc, edje_test_filters);
280 tcase_add_test(tc, edje_test_snapshot);
256} 281}