Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_action_slider_tc1.c
1 /*
2  * Tested interface: AtkObject
3  *
4  * Tested AtkObject: EailActionSlider
5  *
6  * Description: Test whether accessible object is successfully registered
7  *    in GObject type system and is visible in AtkObject tree.
8  *
9  * Test input: accessible object representing EailActionSlider
10  *
11  * Expected test result: test should return 0 (success)
12  */
13
14 #include <Elementary.h>
15 #include <atk/atk.h>
16
17 #include "eail_test_utils.h"
18
19 INIT_TEST("EailActionSlider")
20
21 static void
22 _init_action_slider(Evas_Object *win)
23 {
24    Evas_Object *bg, *bx, *as;
25
26    bg = elm_bg_add(win);
27    elm_win_resize_object_add(win, bg);
28    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, 0);
29    evas_object_show(bg);
30
31    bx = elm_box_add(win);
32    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0);
33    elm_win_resize_object_add(win, bx);
34    evas_object_show(bx);
35
36    as = elm_actionslider_add(win);
37    evas_object_size_hint_weight_set(as, EVAS_HINT_EXPAND, 0);
38    evas_object_size_hint_align_set(as, EVAS_HINT_FILL, 0);
39    elm_object_part_text_set(as, "left", "left1");
40    elm_object_part_text_set(as, "center", "center1");
41    elm_object_part_text_set(as, "right", "right1");
42    elm_actionslider_indicator_pos_set(as, ELM_ACTIONSLIDER_LEFT);
43    evas_object_show(as);
44    elm_box_pack_end(bx, as);
45 }
46
47 static void
48 _do_test(AtkObject *obj)
49 {
50    g_assert(ATK_IS_OBJECT(obj));
51    g_assert(atk_object_get_role(obj) == ATK_ROLE_SLIDER);
52    atk_object_set_description(obj, "test");
53    g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
54    atk_object_set_name(obj, "test name");
55    g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
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_action_slider(win);
68    evas_object_show(win);
69    elm_run();
70    elm_shutdown();
71
72    return 0;
73 }
74 ELM_MAIN()