Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_button_tc4.c
1 /*
2  * Tested interface: AtkText
3  *
4  * Tested AtkObject: EailButton
5  *
6  * Description: Test AtkText interface
7  *
8  * Test input: accessible object representing EailButton
9  *
10  * Expected test result: test should return 0 (success)
11  */
12
13 #include <Elementary.h>
14 #include <atk/atk.h>
15
16 #include "eail_test_utils.h"
17
18 #define BUTTON_TEXT2   "button2"
19
20 #define ICON_SIZE 56
21
22 INIT_TEST("EailButton")
23
24 static void
25 _do_test(AtkObject *obj)
26 {
27    g_assert(ATK_IS_TEXT(obj));
28    g_assert(atk_text_get_character_at_offset(ATK_TEXT(obj), 1) == 'u');
29    g_assert(atk_text_get_character_count(ATK_TEXT(obj)) == 7);
30    g_assert_cmpstr(atk_text_get_text(ATK_TEXT(obj), 1, 4), ==, "utt");
31
32    eailu_test_code_called = 1;
33 }
34
35 static void
36 _init_button(Evas_Object *win)
37 {
38    Evas_Object *bg, *button2;
39
40    bg = elm_bg_add(win);
41    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
42    elm_win_resize_object_add(win, bg);
43    evas_object_show(bg);
44
45    button2 = elm_button_add(win);
46    elm_object_text_set(button2, BUTTON_TEXT2);
47    evas_object_resize(button2, 140, 60);
48    evas_object_show(button2);
49 }
50
51 EAPI_MAIN int
52 elm_main(int argc, char **argv)
53 {
54    Evas_Object *win;
55
56    win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
57    _init_button(win);
58    evas_object_show(win);
59    elm_run();
60    elm_shutdown();
61
62    return 0;
63 }
64 ELM_MAIN()