2 * Tested interface: AtkObject
4 * Tested AtkObject: EailConformant
6 * Description: Test AtkObject interface
8 * Test input: accessible object representing EailConformant
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 INIT_TEST("EailConformant")
21 _do_test(AtkObject *obj)
24 AtkRole role = atk_object_get_role(obj);
25 g_assert(role == ATK_ROLE_FILLER);
27 atk_object_set_description(obj, "test");
28 g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
30 atk_object_set_name(obj, "test name");
31 g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
33 child_count = atk_object_get_n_accessible_children(obj);
34 g_assert(child_count == 1);
36 for (int i = 0; i < child_count; i++)
38 AtkObject *child = atk_object_ref_accessible_child(obj, i);
39 g_assert(ATK_IS_OBJECT(child));
40 role = atk_object_get_role(child);
41 g_assert(role == ATK_ROLE_FILLER);
42 g_object_unref(child);
45 eailu_test_atk_focus(obj, TRUE);
47 eailu_test_code_called = 1;
51 elm_main(int argc, char **argv)
53 Evas_Object *win, *bg, *conform, *btn, *bx, *en;
55 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
56 elm_win_conformant_set(win, EINA_TRUE);
59 elm_win_resize_object_add(win, bg);
60 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
63 conform = elm_conformant_add(win);
64 elm_win_resize_object_add(win, conform);
65 evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
66 evas_object_show(conform);
68 bx = elm_box_add(win);
69 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
70 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
72 btn = elm_button_add(win);
73 elm_object_text_set(btn, "Test Conformant");
74 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
75 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
76 elm_box_pack_end(bx, btn);
77 evas_object_show(btn);
79 en = elm_entry_add(win);
80 elm_entry_scrollable_set(en, EINA_TRUE);
81 elm_object_text_set(en,
82 "This is a multi-line entry at the bottom<br>"
83 "This can contain more than 1 line of text and be "
84 "scrolled around to allow for entering of lots of "
85 "content. It is also to test to see that autoscroll "
86 "moves to the right part of a larger multi-line "
87 "text entry that is inside of a scroller than can be "
88 "scrolled around, thus changing the expected position "
89 "as well as cursor changes updating auto-scroll when "
92 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
93 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
95 elm_box_pack_end(bx, en);
97 btn = elm_button_add(win);
98 elm_object_text_set(btn, "Test Conformant");
99 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0);
100 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0);
101 elm_box_pack_end(bx, btn);
102 evas_object_show(btn);
104 elm_object_content_set(conform, bx);
105 evas_object_show(bx);
107 evas_object_resize(win, 240, 480);
108 evas_object_show(win);