2 * Tested interface: AtkImage
4 * Tested AtkObject: EailThumb
6 * Description: Test AtkImage interface
8 * Test input: accessible object representing EailThumb
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 #define ACTIONS_NUMBER 1
20 INIT_TEST("EailThumb")
23 _init_thumb(Evas_Object *win)
25 const char *filename = "./data/06.jpg";
26 Evas_Object *bg, *thumb;
31 elm_win_resize_object_add(win, bg);
32 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
35 thumb = elm_thumb_add(win);
36 elm_thumb_editable_set(thumb, EINA_FALSE);
37 elm_thumb_file_set(thumb, filename, NULL);
38 elm_thumb_reload(thumb);
39 evas_object_size_hint_weight_set(thumb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
40 elm_win_resize_object_add(win, thumb);
41 evas_object_show(thumb);
45 _do_test(AtkObject *obj)
47 const char * const desc_test = "top secret";
49 int height = 0, width = 0;
52 g_assert(ATK_IS_IMAGE(obj));
54 atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
56 g_assert(NULL == atk_image_get_image_description(ATK_IMAGE(obj)));
57 g_assert(TRUE == atk_image_set_image_description(ATK_IMAGE(obj), desc_test));
58 desc = atk_image_get_image_description(ATK_IMAGE(obj));
59 g_assert(NULL != desc);
60 g_assert_cmpstr(desc_test, ==, desc);
62 atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
63 g_assert(height == 128 && width == 128);
65 eailu_test_code_called = 1;
69 elm_main(int argc, char **argv)
73 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
76 evas_object_show(win);