Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_thumb_tc2.c
1 /*
2  * Tested interface: AtkAction
3  *
4  * Tested AtkObject: EailThumb
5  *
6  * Description: Test AtkAction interface
7  *
8  * Test input: accessible object representing EailThumb
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 ACTIONS_NUMBER 1
19
20 INIT_TEST("EailThumb")
21
22 static void
23 _init_thumb(Evas_Object *win)
24 {
25    const char *filename = "./data/06.jpg";
26    Evas_Object *bg, *thumb;
27
28    elm_need_ethumb();
29
30    bg = elm_bg_add(win);
31    elm_win_resize_object_add(win, bg);
32    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
33    evas_object_show(bg);
34
35    thumb = elm_thumb_add(win);
36    elm_thumb_editable_set(thumb, EINA_FALSE);
37    elm_thumb_file_set(thumb, filename, NULL);
38    elm_thumb_reload(thumb);
39    evas_object_size_hint_weight_set(thumb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
40    elm_win_resize_object_add(win, thumb);
41    evas_object_show(thumb);
42 }
43
44 static void
45 _do_test(AtkObject *obj)
46 {
47    g_assert(ATK_IS_ACTION(obj));
48
49    g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
50
51    eailu_test_action_activate(ATK_ACTION(obj), "click");
52
53    g_assert(-1 == (eailu_get_action_number(ATK_ACTION(obj), "typo")));
54
55    eailu_test_action_description_all(ATK_ACTION(obj));
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_thumb(win);
68    evas_object_show(win);
69    elm_run();
70    elm_shutdown();
71
72    return 0;
73 }
74 ELM_MAIN()