summaryrefslogtreecommitdiff
path: root/src
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
parent6ac4f7154b7750b7c9765f74428e2ebcc83290d9 (diff)
Edje: Add test case for SNAPSHOT
This is mostly an edje_cc compilation test.
Diffstat (limited to '')
-rw-r--r--src/Makefile_Edje.am8
-rw-r--r--src/tests/edje/data/test_snapshot.edc61
-rw-r--r--src/tests/edje/edje_test_edje.c25
3 files changed, 92 insertions, 2 deletions
diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am
index 6e99c855f8..1e5059f082 100644
--- a/src/Makefile_Edje.am
+++ b/src/Makefile_Edje.am
@@ -254,6 +254,7 @@ tests/edje/data/test_layout.edc \
254tests/edje/data/test_parens.edc \ 254tests/edje/data/test_parens.edc \
255tests/edje/data/test_masking.edc \ 255tests/edje/data/test_masking.edc \
256tests/edje/data/test_filters.edc \ 256tests/edje/data/test_filters.edc \
257tests/edje/data/test_snapshot.edc \
257tests/edje/data/filter.lua 258tests/edje/data/filter.lua
258 259
259 260
@@ -295,6 +296,7 @@ EDJE_DATA_FILES = tests/edje/data/test_layout.edc \
295 tests/edje/data/test_parens.edc \ 296 tests/edje/data/test_parens.edc \
296 tests/edje/data/test_masking.edc \ 297 tests/edje/data/test_masking.edc \
297 tests/edje/data/test_filters.edc \ 298 tests/edje/data/test_filters.edc \
299 tests/edje/data/test_snapshot.edc \
298 tests/edje/data/filter.lua 300 tests/edje/data/filter.lua
299 301
300edjedatafilesdir = $(datadir)/edje/data 302edjedatafilesdir = $(datadir)/edje/data
@@ -302,13 +304,15 @@ edjedatafiles_DATA = tests/edje/data/test_layout.edj \
302 tests/edje/data/complex_layout.edj \ 304 tests/edje/data/complex_layout.edj \
303 tests/edje/data/test_parens.edj \ 305 tests/edje/data/test_parens.edj \
304 tests/edje/data/test_masking.edj \ 306 tests/edje/data/test_masking.edj \
305 tests/edje/data/test_filters.edj 307 tests/edje/data/test_filters.edj \
308 tests/edje/data/test_snapshot.edj
306 309
307CLEANFILES += tests/edje/data/test_layout.edj \ 310CLEANFILES += tests/edje/data/test_layout.edj \
308 tests/edje/data/complex_layout.edj \ 311 tests/edje/data/complex_layout.edj \
309 tests/edje/data/test_parens.edj \ 312 tests/edje/data/test_parens.edj \
310 tests/edje/data/test_masking.edj \ 313 tests/edje/data/test_masking.edj \
311 tests/edje/data/test_filters.edj 314 tests/edje/data/test_filters.edj \
315 tests/edje/data/test_snapshot.edj
312 316
313endif 317endif
314 318
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}