2 * Tested interface: AtkObject
4 * Tested AtkObject: EailButton
6 * Description: Test whether EailIcon is only child of EailButton
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;
31 _printf("Button test: %s\n", BUTTON_TEXT2);
33 g_assert(1 == atk_object_get_n_accessible_children(obj));
35 xobj = atk_object_ref_accessible_child(obj, 0);
36 g_assert(NULL != xobj);
37 type_name_child = g_type_name(G_TYPE_FROM_INSTANCE(xobj));
38 _printf("type_name_child: %s\n", type_name_child);
39 g_assert_cmpstr(type_name_child, ==, "EailIcon");
41 eailu_test_code_called = 1;
45 _init_button(Evas_Object *win)
47 Evas_Object *bg, *icon, *button2;
50 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
51 elm_win_resize_object_add(win, bg);
54 icon = elm_icon_add(win);
55 elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
56 elm_icon_standard_set(icon, "home");
57 evas_object_show(icon);
59 button2 = elm_button_add(win);
60 elm_object_text_set(button2, BUTTON_TEXT2);
61 elm_object_part_content_set(button2, "icon", icon);
62 evas_object_resize(button2, 140, 60);
63 evas_object_show(button2);
67 elm_main(int argc, char **argv)
71 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
73 evas_object_show(win);