2 * Tested interface: AtkImage
4 * Tested AtkObject: EailPhotocam
6 * Description: Test AtkImage interface
8 * Test input: accessible object representing EailPhotocam
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 INIT_TEST("EailPhotocam")
21 _do_test(AtkObject *obj)
23 const char * const desc_test = "top secret";
25 int height = 0, width = 0;
28 g_assert(ATK_IS_IMAGE(obj));
30 atk_image_get_image_position(ATK_IMAGE(obj), &x, &y, ATK_XY_SCREEN);
31 _printf("atk_image_get_image_position on screen: x: %d y %d\n", x, y);
33 g_assert(NULL == atk_image_get_image_description(ATK_IMAGE(obj)));
34 g_assert(TRUE == atk_image_set_image_description(ATK_IMAGE(obj), desc_test));
35 desc = atk_image_get_image_description(ATK_IMAGE(obj));
36 _printf("atk_image_get_image_description: %s\n", desc ? desc : "NULL");
37 g_assert(NULL != desc);
38 g_assert_cmpstr(desc_test, ==, desc);
40 atk_image_get_image_size(ATK_IMAGE(obj), &height, &width);
41 _printf("atk_image_get_image_size: height %d width %d\n", height, width);
43 eailu_test_code_called = 1;
47 _init_photocam(Evas_Object *win)
49 Evas_Object *bg, *photocam;
50 const char * const filename = "./data/whiterabbit01.jpg";
53 elm_bg_color_set(bg, 255, 255, 255);
54 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
55 elm_win_resize_object_add(win, bg);
58 photocam = elm_photocam_add(win);
59 g_assert(EVAS_LOAD_ERROR_NONE == elm_photocam_file_set(photocam, filename));
60 elm_scroller_bounce_set(photocam, EINA_FALSE, EINA_TRUE);
61 evas_object_resize(photocam, 300, 300);
62 evas_object_show(photocam);
66 elm_main(int argc, char **argv)
70 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
73 evas_object_show(win);