Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_route_tc1.c
1 /*
2  * Tested interface: AtkObject
3  *
4  * Tested AtkObject: EailRoute
5  *
6  * Description: Test AtkObject interface
7  *
8  * Test input: accessible object representing EailRoute
9  *
10  * Expected test result: test should return 0 (success)
11  */
12
13
14 #include <Elementary.h>
15 #include <atk/atk.h>
16
17 #include "eail_test_utils.h"
18
19 INIT_TEST("EailRoute")
20
21 static void
22 _init_route(Evas_Object *win)
23 {
24    Evas_Object *bg;
25
26    bg = elm_bg_add(win);
27    elm_win_resize_object_add(win, bg);
28    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
29    evas_object_show(bg);
30
31    elm_route_add(win);
32 }
33
34 static void
35 _do_test(AtkObject *obj)
36 {
37    const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
38    const char *role_name = atk_role_get_name(atk_object_get_role(obj));
39
40    _printf("atk_object_get_role: %s\n", role_name ? role_name : "NULL");
41    _printf("atk_object_get_type_name: %s\n", type_name ? type_name : "NULL");
42
43    g_assert(ATK_IS_OBJECT(obj));
44    atk_object_set_description(obj, "test");
45    g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
46
47    atk_object_set_name(obj, "test name");
48    g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
49
50    g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE_MAP);
51
52    /* NOTE: route widget does not support focus */
53    eailu_test_atk_focus(obj, FALSE);
54
55    eailu_test_code_called = 1;
56 }
57
58 EAPI_MAIN int
59 elm_main(int argc, char **argv)
60 {
61    Evas_Object *win;
62
63    win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
64    g_assert(win);
65    _init_route(win);
66    evas_object_show(win);
67    elm_run();
68    elm_shutdown();
69
70    return 0;
71 }
72 ELM_MAIN()