Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_thumb_tc1.c
1 /*
2  * Tested interface: AtkObject
3  *
4  * Tested AtkObject: EailThumb
5  *
6  * Description: Test AtkObject 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 #include "eail_test_utils.h"
16
17 INIT_TEST("EailThumb")
18
19 static void
20 _init_thumb(Evas_Object *win)
21 {
22    const char *filename = "./data/06.jpg";
23    Evas_Object *bg, *thumb;
24
25    elm_need_ethumb();
26
27    bg = elm_bg_add(win);
28    elm_win_resize_object_add(win, bg);
29    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
30    evas_object_show(bg);
31
32    thumb = elm_thumb_add(win);
33    elm_thumb_editable_set(thumb, EINA_FALSE);
34    elm_thumb_file_set(thumb, filename, NULL);
35    elm_thumb_reload(thumb);
36    evas_object_size_hint_weight_set(thumb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
37    elm_win_resize_object_add(win, thumb);
38    evas_object_show(thumb);
39 }
40
41 static void
42 _do_test(AtkObject *obj)
43 {
44    g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
45    atk_object_set_description(obj, "test");
46    g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
47
48    atk_object_set_name(obj, "test name");
49    g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
50
51    g_assert(NULL != atk_object_ref_state_set(obj));
52
53    eailu_test_code_called = 1;
54 }
55
56 EAPI_MAIN int
57 elm_main(int argc, char **argv)
58 {
59    Evas_Object *win;
60
61    win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
62    g_assert(win);
63    _init_thumb(win);
64    evas_object_show(win);
65    elm_run();
66    elm_shutdown();
67
68    return 0;
69 }
70 ELM_MAIN()