2 * Tested interface: AtkAction
4 * Tested AtkObject: EailFlipselector
6 * Description: Test AtkAction interface
8 * Test input: accessible object representing EailFlipselector
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 #define ITEM_SEL_EINA 2
19 #define ITEM_SEL_EDJE 3
20 #define ITEM_SEL_ELM 0
21 #define ACTIONS_COUNT 2
23 INIT_TEST("EailFlipselector")
26 _init_flipselector(Evas_Object *win)
29 Evas_Object *bg, *bx, *fp;
30 static const char *lbl[] =
43 elm_win_resize_object_add(win, bg);
44 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
47 bx = elm_box_add(win);
48 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
49 elm_win_resize_object_add(win, bx);
52 fp = elm_flipselector_add(win);
53 evas_object_size_hint_weight_set(fp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
55 for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
56 elm_flipselector_item_append(fp, lbl[i], NULL, NULL);
58 elm_box_pack_end(bx, fp);
63 _do_test(AtkObject *obj)
65 g_assert(ATK_IS_ACTION(obj));
67 g_assert(atk_action_get_n_actions(ATK_ACTION(obj)) == ACTIONS_COUNT);
69 g_assert(atk_selection_add_selection(ATK_SELECTION(obj), ITEM_SEL_EINA));
70 eailu_test_action_activate(ATK_ACTION(obj), "next");
71 g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EDJE));
73 eailu_test_action_activate(ATK_ACTION(obj), "previous");
74 g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));
76 g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
78 eailu_test_action_description_all(ATK_ACTION(obj));
80 eailu_test_code_called = 1;
84 elm_main(int argc, char **argv)
86 Evas_Object *win = NULL;
88 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
89 _init_flipselector(win);
90 evas_object_show(win);