Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_plug_tc2.c
1 /*
2  * Tested interface: AtkAction
3  *
4  * Tested AtkObject: EailPlug
5  *
6  * Description: Test AtkAction 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 #define ACTIONS_NUMBER 1
21
22 INIT_TEST("EailPlug")
23
24 static void
25 _init_plug(Evas_Object *win)
26 {
27    Evas_Object *bg, *plug;
28    const char *filename = "data/plant_01.jpg";
29
30    bg = elm_bg_add(win);
31    elm_bg_file_set(bg, filename, NULL);
32    elm_win_resize_object_add(win, bg);
33    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
34    evas_object_show(bg);
35
36    plug = elm_plug_add(win);
37    evas_object_resize(plug, 380, 500);
38    evas_object_move(plug, 10, 10);
39    evas_object_show(plug);
40 }
41
42 static void
43 _do_test(AtkObject *obj)
44 {
45    g_assert(ATK_IS_ACTION(obj));
46
47    g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
48
49    eailu_test_action_activate(ATK_ACTION(obj), "click");
50
51    g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
52
53    eailu_test_action_description_all(ATK_ACTION(obj));
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()