summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-05-08 10:45:27 +0900
committerHermet Park <chuneon.park@samsung.com>2020-05-08 10:45:27 +0900
commit882e4cd50f6c0c9d4b7c2825ba66cff42d1d476d (patch)
tree210b87340549d169e937f8dd2d8449854b332ee5
parent752725ea18237075121fe9f7600d522eb610e335 (diff)
tests/elm: add callback testing to image memfile test
Summary: verify that ready is called (preload done) and error is not called ref D11758 Reviewers: Hermet, jsuya, kimcinoo Reviewed By: Hermet Subscribers: stefan_schmidt, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11760
-rw-r--r--src/tests/elementary/elm_test_image.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tests/elementary/elm_test_image.c b/src/tests/elementary/elm_test_image.c
index 888069f2b7..25aac89a42 100644
--- a/src/tests/elementary/elm_test_image.c
+++ b/src/tests/elementary/elm_test_image.c
@@ -257,10 +257,11 @@ EFL_END_TEST
257 257
258EFL_START_TEST(elm_image_test_memfile_set) 258EFL_START_TEST(elm_image_test_memfile_set)
259{ 259{
260 Evas_Object *win, *image; 260 Evas_Object *win, *image, *image2;
261 char *mem; 261 char *mem;
262 int size; 262 int size;
263 const char *file = NULL; 263 const char *file = NULL;
264 int error_called = 0;
264 265
265 win = win_add(NULL, "image", ELM_WIN_BASIC); 266 win = win_add(NULL, "image", ELM_WIN_BASIC);
266 267
@@ -274,6 +275,15 @@ EFL_START_TEST(elm_image_test_memfile_set)
274 ck_assert(elm_image_file_set(image, ELM_IMAGE_DATA_DIR"/images/icon_01.png", NULL)); 275 ck_assert(elm_image_file_set(image, ELM_IMAGE_DATA_DIR"/images/icon_01.png", NULL));
275 elm_image_file_get(image, &file, NULL); 276 elm_image_file_get(image, &file, NULL);
276 ck_assert_str_eq(file, ELM_IMAGE_DATA_DIR"/images/icon_01.png"); 277 ck_assert_str_eq(file, ELM_IMAGE_DATA_DIR"/images/icon_01.png");
278
279 image2 = elm_image_add(win);
280 evas_object_smart_callback_add(image2, "load,ready", event_callback_that_quits_the_main_loop_when_called, NULL);
281 evas_object_smart_callback_add(image2, "load,error", event_callback_single_call_int_data, &error_called);
282 ck_assert(elm_image_memfile_set(image2, mem, size, "png", NULL));
283 ck_assert_int_eq(error_called, 0);
284 ecore_main_loop_begin();
285
286 ck_assert_int_eq(error_called, 0);
277} 287}
278EFL_END_TEST 288EFL_END_TEST
279 289