2 * Tested interface: AtkImage
4 * Tested AtkObject: EailPhoto
6 * Description: Test AtkImage interface
8 * Test input: accessible object representing EailPhoto
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
15 #include "eail_test_utils.h"
17 INIT_TEST("EailPhoto")
20 _do_test(AtkObject *obj)
22 const char * const desc_test = "top secret";
24 int height = 0, width = 0;
27 g_assert(ATK_IS_IMAGE(obj));
29 atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
30 _printf("atk_image_get_image_position on screen: x: %d y %d\n", x, y);
32 g_assert(NULL == atk_image_get_image_description(ATK_IMAGE(obj)));
33 g_assert(TRUE == atk_image_set_image_description(ATK_IMAGE(obj), desc_test));
34 desc = atk_image_get_image_description(ATK_IMAGE(obj));
35 _printf("atk_image_get_image_description: %s\n", desc ? desc : "NULL");
36 g_assert(NULL != desc);
37 g_assert_cmpstr(desc_test, ==, desc);
39 atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
40 _printf("atk_image_get_image_size: height %d width %d\n", height, width);
42 eailu_test_code_called = 1;
46 _init_photo(Evas_Object *win)
48 Evas_Object *bx, *photo;
49 const char * const filename = "data/th-whiterabbit01.jpg";
51 bx = elm_box_add(win);
52 elm_box_horizontal_set(bx, EINA_TRUE);
53 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
54 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
55 elm_box_homogeneous_set(bx, EINA_TRUE);
56 elm_win_resize_object_add(win, bx);
58 photo = elm_photo_add(win);
59 g_assert(elm_photo_file_set(photo, filename));
60 elm_photo_size_set(photo, 100);
61 elm_photo_aspect_fixed_set(photo, EINA_FALSE);
62 evas_object_size_hint_weight_set(photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
63 elm_photo_fill_inside_set(photo, EINA_TRUE);
64 evas_object_size_hint_align_set(photo, EVAS_HINT_FILL, EVAS_HINT_FILL);
65 elm_box_pack_end(bx, photo);
66 evas_object_show(photo);
72 elm_main(int argc, char **argv)
76 win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
80 evas_object_show(win);