2 * Tested interface: AtkAobject
4 * Tested AtkObject: EailMultibuttonEntry
6 * Description: Test AtkObject interface
8 * Test input: accessible object representing EailMultibuttonEntry
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 #define EAIL_TYPE_FOR_MBE "EailMultibuttonentry"
19 #define EAIL_TEST_INPUT_TEXT "Input text"
21 INIT_TEST("EailMultibuttonentry")
24 _do_test(AtkObject *obj)
26 int child_amount = 0, i =0;
27 AtkObject *nested_obj;
28 atk_object_set_description(obj, "test");
29 g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
31 atk_object_set_name(obj, "test name");
32 g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
33 /* standard tests, types, child num etc.*/
34 child_amount = atk_object_get_n_accessible_children(obj);
35 g_assert(4 == child_amount);
36 for (i = 0; i < child_amount; ++i)
38 nested_obj = atk_object_ref_accessible_child(obj, i);
40 eailu_is_object_with_role(nested_obj, ATK_ROLE_LABEL);
41 eailu_is_object_with_type(nested_obj, "EailItem");
43 g_object_unref(nested_obj);
46 eailu_test_code_called = 1;
50 _init_multibuttonentry(Evas_Object *win)
52 Evas_Object *scroller, *bg, *box, *mb_entry;
55 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
56 elm_win_resize_object_add(win, bg);
59 box = elm_box_add(win);
60 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
61 elm_win_resize_object_add(win, box);
62 evas_object_show(box);
64 scroller = elm_scroller_add(win);
65 elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_TRUE);
66 elm_scroller_policy_set
67 (scroller, ELM_SCROLLER_POLICY_OFF,ELM_SCROLLER_POLICY_AUTO);
68 evas_object_show(scroller);
70 mb_entry = elm_multibuttonentry_add(win);
71 elm_object_part_text_set(mb_entry, "guide", "Tap to add recipient");
72 elm_object_text_set(mb_entry, EAIL_TEST_INPUT_TEXT);
73 evas_object_size_hint_weight_set(mb_entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
74 evas_object_size_hint_align_set(mb_entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
75 elm_object_content_set(scroller, mb_entry);
76 evas_object_show(mb_entry);
78 elm_multibuttonentry_item_append(mb_entry, "first", NULL, NULL);
79 elm_multibuttonentry_item_append(mb_entry, "second", NULL, NULL);
80 elm_multibuttonentry_item_append(mb_entry, "third", NULL, NULL);
81 elm_multibuttonentry_item_append(mb_entry, "fourth", NULL, NULL);
83 elm_object_focus_set(mb_entry, EINA_TRUE);
84 elm_box_pack_end(box, mb_entry);
86 evas_object_resize(win, 130, 180);
90 elm_main(int argc, char **argv)
94 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
95 _init_multibuttonentry(win);
97 evas_object_show(win);