2 * Tested interface: AtkObject
4 * Tested AtkObject: EailBubble
6 * Description: Test AtkObject interface
8 * Test input: accessible object representing EailBubble
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 INIT_TEST("EailBubble")
21 _init_bubble(Evas_Object *win)
23 Evas_Object *bg, *label, *icon, *bubble;
26 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
27 elm_win_resize_object_add(win, bg);
30 label = elm_label_add(win);
31 elm_object_text_set(label, "This is the CONTENT of our bubble");
32 evas_object_show(label);
34 icon = elm_icon_add(win);
35 elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
36 elm_icon_standard_set(icon, "home");
37 evas_object_show(icon);
39 bubble = elm_bubble_add(win);
40 elm_object_part_content_set(bubble, "icon", icon);
41 elm_object_part_text_set(bubble, "info", "INFO");
42 elm_object_text_set(bubble, "LABEL");
43 elm_object_content_set(bubble, label);
44 evas_object_resize(bubble, 300, 100);
45 evas_object_show(bubble);
49 _do_test(AtkObject *obj)
51 const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
52 const char *type_name_child;
55 g_assert(ATK_IS_OBJECT(obj));
57 atk_object_set_description(obj, "test");
58 g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
59 atk_object_set_name(obj, "test name");
60 g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
62 g_assert(atk_object_get_role(obj) == ATK_ROLE_FILLER);
64 g_assert_cmpstr(type_name, ==, "EailBubble");
67 g_assert(2 == atk_object_get_n_accessible_children(obj));
69 for (int count = 0; 2 > count; count++)
71 xobj = atk_object_ref_accessible_child(obj, count);
73 type_name_child = g_type_name(G_TYPE_FROM_INSTANCE(xobj));
74 _printf(" child num: %d, type_name: %s\n", count, type_name_child);
75 g_assert(!strcmp(type_name_child, "EailIcon") || !strcmp(type_name_child, "EailLabel"));
78 /* bubble object does not support focus */
79 eailu_test_atk_focus(obj, FALSE);
81 eailu_test_code_called = 1;
85 elm_main(int argc, char **argv)
89 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
92 evas_object_show(win);