Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_calendar_tc1.c
1 /*
2  * Tested interface: AtkObject
3  *
4  * Tested AtkObject: EailCalendar
5  *
6  * Description: Test AtkObject interface
7  *
8  * Test input: accessible object representing EailCalendar
9  *
10  * Expected test result: test should return 0 (success)
11  */
12
13 #include <Elementary.h>
14 #include <atk/atk.h>
15
16 #define DEBUG 1
17 #include "eail_test_utils.h"
18
19 INIT_TEST("EailCalendar")
20
21 static int year_limit_min = 2000;
22 static int year_limit_max = 2030;
23
24 static void
25 _init_calendar(Evas_Object *win)
26 {
27    Evas_Object *bg, *cal;
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    cal = elm_calendar_add(win);
35    elm_calendar_min_max_year_set(cal, year_limit_min, year_limit_max);
36    elm_win_resize_object_add(win, cal);
37    evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
38    evas_object_show(cal);
39 }
40
41 static void
42 _do_test(AtkObject *obj)
43 {
44    g_assert(atk_object_get_role(obj) == ATK_ROLE_CALENDAR);
45
46    atk_object_set_name(obj, "cal");
47    g_assert_cmpstr(atk_object_get_name(obj), ==, "cal");
48    atk_object_set_description(obj, "test");
49    g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
50
51    atk_object_set_name(obj, "test name");
52    g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
53
54    /* calendar object to support focus */
55    eailu_test_atk_focus(obj, TRUE);
56
57    eailu_test_code_called = 1;
58 }
59
60 EAPI_MAIN int
61 elm_main(int argc, char **argv)
62 {
63    Evas_Object *win;
64
65    win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
66    g_assert(win);
67    _init_calendar(win);
68    evas_object_show(win);
69    elm_run();
70    elm_shutdown();
71
72    return 0;
73 }
74 ELM_MAIN()