Merge "custom eail widget implementation" into tizen
[platform/core/uifw/eail.git] / tests / eail_photocam_tc1.c
1 /*
2  * Tested interface: AtkObject
3  *
4  * Tested AtkObject: EailPhotocam
5  *
6  * Description: Test AtkObject interface
7  *
8  * Test input: accessible object representing EailPhotocam
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("EailPhotocam");
21
22 static void
23 _do_test(AtkObject *obj)
24 {
25    g_assert(ATK_IS_OBJECT(obj));
26    atk_object_set_description(obj, "test");
27    g_assert_cmpstr(atk_object_get_description(obj), ==, "test");
28
29    atk_object_set_name(obj, "test name");
30    g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
31
32    AtkStateSet *state_set = atk_object_ref_state_set(obj);
33
34    g_assert(!atk_state_set_is_empty(state_set));
35
36    g_object_unref(state_set);
37
38    eailu_test_code_called = 1;
39 }
40
41 static void
42 _init_photocam(Evas_Object *win)
43 {
44    Evas_Object *bg, *photocam;
45    const char * const filename = "./data/whiterabbit01.jpg";
46
47    bg = elm_bg_add(win);
48    elm_bg_color_set(bg, 255, 255, 255);
49    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
50    elm_win_resize_object_add(win, bg);
51    evas_object_show(bg);
52
53    photocam = elm_photocam_add(win);
54    g_assert(EVAS_LOAD_ERROR_NONE == elm_photocam_file_set(photocam, filename));
55    elm_scroller_bounce_set(photocam, EINA_FALSE, EINA_TRUE);
56    evas_object_resize(photocam, 300, 300);
57    evas_object_show(photocam);
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_photocam(win);
68    evas_object_show(win);
69    elm_run();
70    elm_shutdown();
71
72    return 0;
73 }
74 ELM_MAIN()