2 * Tested interface: AtkAction
4 * Tested AtkObject: EailButton
6 * Description: Test AtkAction interface
8 * Test input: accessible object representing EailButton
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
20 #define ACTIONS_NUMBER 3
21 #define BUTTON_TEXT1 "Button1"
22 #define BUTTON_TEXT2 "button2"
24 static int action_test_passed;
26 INIT_TEST("EailButton")
29 _on_click(void *data, Evas_Object *obj, void *event_info)
31 _printf("button click\n");
36 _on_press(void *data, Evas_Object *obj, void *event_info)
38 _printf("button press\n");
43 _on_release(void *data, Evas_Object *obj, void *event_info)
45 _printf("button release\n");
50 _do_test(AtkObject *obj)
52 g_assert(ATK_IS_ACTION(obj));
54 g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
55 eailu_test_action_activate(ATK_ACTION(obj), "click");
56 eailu_test_action_activate(ATK_ACTION(obj), "press");
57 eailu_test_action_activate(ATK_ACTION(obj), "release");
58 g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
59 eailu_test_action_description_all(ATK_ACTION(obj));
61 g_assert(action_test_passed == 3);
63 eailu_test_code_called = 1;
67 _init_button(Evas_Object *win)
69 Evas_Object *bg, *icon, *button1;
72 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
73 elm_win_resize_object_add(win, bg);
76 icon = elm_icon_add(win);
77 elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
78 elm_icon_standard_set(icon, "home");
79 evas_object_show(icon);
81 button1 = elm_button_add(win);
82 elm_object_text_set(button1, BUTTON_TEXT1);
83 evas_object_smart_callback_add(button1, "clicked", _on_click, "button1");
84 evas_object_smart_callback_add(button1, "pressed", _on_press, "button1");
85 evas_object_smart_callback_add(button1, "unpressed", _on_release, "button1");
87 evas_object_resize(button1, 140, 60);
88 evas_object_move(button1, 50, 20);
89 evas_object_show(button1);
93 elm_main(int argc, char **argv)
97 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
100 evas_object_show(win);