Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_plug_tc1.c
1 /*
2  * Tested interface: AtkObject
3  *
4  * Tested AtkObject: EailPlug
5  *
6  * Description: Test AtkObject interface
7  *
8  * Test input: accessible object representing EailPlug
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
18 #include "eail_test_utils.h"
19
20 INIT_TEST("EailPlug")
21
22 static void
23 _init_plug(Evas_Object *win)
24 {
25    Evas_Object *bg, *plug;
26    const char *filename = "data/plant_01.jpg";
27
28    bg = elm_bg_add(win);
29    elm_bg_file_set(bg, filename, NULL);
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    plug = elm_plug_add(win);
35    evas_object_resize(plug, 380, 500);
36    evas_object_move(plug, 10, 10);
37    evas_object_show(plug);
38 }
39
40 static void
41 _do_test(AtkObject *obj)
42 {
43    const char *type_name = g_type_name(G_TYPE_FROM_INSTANCE(obj));
44
45    g_assert(ATK_IS_OBJECT(obj));
46    atk_object_set_description(obj, "test");
47    g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
48    g_assert_cmpstr(type_name, ==, "EailPlug");
49
50    atk_object_set_name(obj, "test name");
51    g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
52
53    g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
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_plug(win);
66    evas_object_show(win);
67    elm_run();
68    elm_shutdown();
69
70    return 0;
71 }
72 ELM_MAIN()