Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_colorselector_tc1.c
1 /*
2  * Tested interface: AtkObject
3  *
4  * Tested AtkObject: EailColorselector
5  *
6  * Description: Test AtkObject interface
7  *
8  * Test input: accessible object representing EailColorselector
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 INIT_TEST("EailColorselector")
19
20 static void
21 _init_colorselector(Evas_Object *obj)
22 {
23    Evas_Object *bx = NULL;
24    Evas_Object *cs = NULL;
25    Evas_Object *fr = NULL;
26
27    bx = elm_box_add(obj);
28    evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
29    evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
30    elm_win_resize_object_add(obj, bx);
31    evas_object_show(bx);
32
33    fr = elm_frame_add(obj);
34    evas_object_size_hint_weight_set(fr, 1.0, 0.5);
35    evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
36    elm_object_text_set(fr, "Color Selector");
37    elm_box_pack_end(bx, fr);
38    evas_object_show(fr);
39
40    cs = elm_colorselector_add(obj);
41    elm_colorselector_palette_name_set(cs, "painting");
42    evas_object_size_hint_weight_set(cs, EVAS_HINT_EXPAND, 0.0);
43    evas_object_size_hint_align_set(cs, EVAS_HINT_FILL, 0.0);
44    elm_colorselector_color_set(cs, 100, 100, 100, 133);
45    evas_object_show(cs);
46    elm_object_content_set(fr, cs);
47
48    evas_object_resize(obj, 320, 480);
49 }
50
51 static void
52 _do_test(AtkObject *obj)
53 {
54    g_assert(ATK_IS_OBJECT(obj));
55    g_assert(atk_object_get_role(obj) == ATK_ROLE_COLOR_CHOOSER);
56
57    atk_object_set_description(obj, "test");
58    g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
59
60    atk_object_set_name(obj, "test name");
61    g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
62
63    eailu_test_code_called = 1;
64 }
65
66
67 EAPI_MAIN int
68 elm_main(int argc, char **argv)
69 {
70    Evas_Object *win = NULL;
71
72    win = eailu_create_test_window_with_glib_init(NULL, _on_focus_in);
73    _init_colorselector(win);
74    evas_object_show(win);
75    elm_run();
76    elm_shutdown();
77
78    return 0;
79 }
80 ELM_MAIN()
81