2 * Tested interface: AtkObject
4 * Tested AtkObject: EailPhoto
6 * Description: Test AtkObject 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"
19 INIT_TEST("EailPhoto")
22 _do_test(AtkObject *obj)
24 g_assert(ATK_IS_OBJECT(obj));
26 g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
28 atk_object_set_name(obj, "test name");
29 g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
31 AtkStateSet *state_set = atk_object_ref_state_set(obj);
32 g_assert(!atk_state_set_is_empty(state_set));
33 g_object_unref(state_set);
35 eailu_test_code_called = 1;
39 _init_photo(Evas_Object *win)
41 Evas_Object *bx, *photo;
42 const char * const filename = "data/th-whiterabbit01.jpg";
44 bx = elm_box_add(win);
45 elm_box_horizontal_set(bx, EINA_TRUE);
46 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
47 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
48 elm_box_homogeneous_set(bx, EINA_TRUE);
49 elm_win_resize_object_add(win, bx);
51 photo = elm_photo_add(win);
52 g_assert(elm_photo_file_set(photo, filename));
53 elm_photo_size_set(photo, 100);
54 elm_photo_aspect_fixed_set(photo, EINA_FALSE);
55 evas_object_size_hint_weight_set(photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
56 elm_photo_fill_inside_set(photo, EINA_TRUE);
57 evas_object_size_hint_align_set(photo, EVAS_HINT_FILL, EVAS_HINT_FILL);
58 elm_box_pack_end(bx, photo);
59 evas_object_show(photo);
65 elm_main(int argc, char **argv)
69 win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
72 evas_object_show(win);