2 * Tested interface: AtkImage
4 * Tested AtkObject: EailButton
6 * Description: Test AtkImage interface
8 * Test input: accessible object representing EailButton
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 #define BUTTON_TEXT2 "button2"
22 INIT_TEST("EailButton")
25 _do_test(AtkObject *obj)
27 const char *type_name_child;
28 int height = 0, width = 0;
32 g_assert(ATK_IS_IMAGE(obj));
34 _printf("Button test: %s\n", BUTTON_TEXT2);
36 g_assert(1 == atk_object_get_n_accessible_children(obj));
38 xobj = atk_object_ref_accessible_child(obj, 0);
39 g_assert(NULL != xobj);
40 type_name_child = g_type_name(G_TYPE_FROM_INSTANCE(xobj));
41 _printf("type_name_child: %s\n", type_name_child);
42 g_assert_cmpstr(type_name_child, ==, "EailIcon");
45 atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
46 _printf("atk_image_get_image_position on screen: x: %d y %d\n", x, y);
48 atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
49 _printf("atk_image_get_image_size: height %d width %d\n", height, width);
50 g_assert(ICON_SIZE == height && ICON_SIZE == width);
52 eailu_test_code_called = 1;
56 _init_button(Evas_Object *win)
58 Evas_Object *bg, *icon, *button2;
61 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
62 elm_win_resize_object_add(win, bg);
65 icon = elm_icon_add(win);
66 elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
67 elm_icon_standard_set(icon, "home");
68 evas_object_show(icon);
70 button2 = elm_button_add(win);
71 elm_object_text_set(button2, BUTTON_TEXT2);
72 elm_object_part_content_set(button2, "icon", icon);
73 evas_object_resize(button2, 140, 60);
74 evas_object_show(button2);
78 elm_main(int argc, char **argv)
82 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
84 evas_object_show(win);