Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_icon_tc2.c
1 /*
2  * Tested interface: AtkAction
3  *
4  * Tested AtkObject: EailIcon
5  *
6  * Description: Test AtkAction interface
7  *
8  * Test input: accessible object representing EailIcon
9  *
10  * Expected test result: test should return 0 (success)
11  */
12
13 #include <Elementary.h>
14 #include <atk/atk.h>
15 #include "eail_test_utils.h"
16
17 #define ACTIONS_NUMBER 1
18
19 #define ICON_NAME "home"
20 #define ICON_SIZE 32
21
22 INIT_TEST("EailIcon")
23
24 static void
25 _init_icon(Evas_Object *win)
26 {
27    Evas_Object *bg, *icon;
28
29    bg = elm_bg_add(win);
30    elm_win_resize_object_add(win, bg);
31    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
32    evas_object_show(bg);
33
34    icon = elm_icon_add(win);
35    elm_icon_order_lookup_set(icon, ELM_ICON_LOOKUP_THEME_FDO);
36    elm_icon_standard_set(icon, ICON_NAME);
37    evas_object_resize(icon, ICON_SIZE, ICON_SIZE);
38    evas_object_show(icon);
39 }
40
41 static void
42 _do_test(AtkObject *obj)
43 {
44    g_assert(ATK_IS_ACTION(obj));
45
46    g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
47
48    eailu_test_action_activate(ATK_ACTION(obj), "click");
49
50    g_assert(-1 == (eailu_get_action_number(ATK_ACTION(obj), "typo")));
51
52    eailu_test_action_description_all(ATK_ACTION(obj));
53
54    eailu_test_code_called = 1;
55 }
56
57 EAPI_MAIN int
58 elm_main(int argc, char **argv)
59 {
60    Evas_Object *win;
61
62    win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
63    g_assert(win);
64    _init_icon(win);
65    evas_object_show(win);
66    elm_run();
67    elm_shutdown();
68
69    return 0;
70 }
71 ELM_MAIN()