2 * Tested interface: AtkSelection
4 * Tested AtkObject: EailFlipselector
6 * Description: Test AtkSelection interface
8 * Test input: accessible object representing EailFlipselector
10 * Expected test result: test should return 0 (success)
14 #include <Elementary.h>
17 #include "eail_test_utils.h"
19 #define ITEM_SEL_EINA 2
20 #define ITEM_SEL_EDJE 3
21 #define ITEM_SEL_ELM 0
22 #define MAX_SELECTIONS 1
24 INIT_TEST("EailFlipselector")
27 _init_flipselector(Evas_Object *win)
30 Evas_Object *bg, *bx, *fp;
31 static const char *lbl[] =
44 elm_win_resize_object_add(win, bg);
45 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
48 bx = elm_box_add(win);
49 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
50 elm_win_resize_object_add(win, bx);
53 fp = elm_flipselector_add(win);
54 evas_object_size_hint_weight_set(fp, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
56 for (i = 0; i < sizeof(lbl) / sizeof(lbl[0]); i++)
57 elm_flipselector_item_append(fp, lbl[i], NULL, NULL);
59 elm_box_pack_end(bx, fp);
64 _do_test(AtkObject *obj)
66 g_assert(ATK_IS_SELECTION(obj));
68 g_assert(atk_selection_add_selection(ATK_SELECTION(obj), ITEM_SEL_EINA));
69 g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));
71 g_assert(atk_selection_clear_selection(ATK_SELECTION(obj)) == FALSE);
73 g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));
75 g_assert(atk_selection_get_selection_count(ATK_SELECTION(obj)) == MAX_SELECTIONS);
77 g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_EINA));
79 g_assert(atk_selection_remove_selection(ATK_SELECTION(obj), ITEM_SEL_EINA));
80 g_assert(atk_selection_is_child_selected(ATK_SELECTION(obj), ITEM_SEL_ELM));
82 g_assert(atk_selection_select_all_selection(ATK_SELECTION(obj)) == FALSE);
84 eailu_test_code_called = 1;
88 elm_main(int argc, char **argv)
90 Evas_Object *win = NULL;
92 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
93 _init_flipselector(win);
94 evas_object_show(win);