2 * Tested interface: AtkObject
4 * Tested AtkObject: EailImage
6 * Description: Test whether accessible object is successfully registered
7 * in GObject type system and is visible in AtkObject tree.
9 * Test input: accessible object representing EailImage
11 * Expected test result: test should return 0 (success)
14 #include <Elementary.h>
17 #include "eail_test_utils.h"
19 INIT_TEST("EailImage")
22 _do_test(AtkObject *obj)
25 const char *desc_test = "top secret";
27 g_assert(ATK_IS_OBJECT(obj));
29 g_assert(atk_object_get_role(obj) == ATK_ROLE_IMAGE);
31 atk_object_set_description(obj, desc_test);
32 g_assert_cmpstr(atk_object_get_description(obj), ==, desc_test);
34 atk_object_set_name(obj, "test name");
35 g_assert_cmpstr(atk_object_get_name(obj), ==, "test name");
37 AtkStateSet *state_set = atk_object_ref_state_set(obj);
38 AtkStateType state_types[] = {ATK_STATE_ANIMATED, ATK_STATE_RESIZABLE};
39 if (atk_state_set_contains_states(state_set, state_types, 2))
40 _printf("atk_ref_state_set: animated and resizable set\n");
41 g_object_unref(state_set);
43 eailu_test_code_called = 1;
47 _init_image(Evas_Object *win)
49 Evas_Object *bg, *image;
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 image = elm_image_add(win);
59 g_assert(elm_image_file_set(image, filename, NULL));
60 elm_image_no_scale_set(image, EINA_TRUE);
61 elm_image_resizable_set(image, EINA_FALSE, EINA_TRUE);
62 elm_image_smooth_set(image, EINA_FALSE);
63 elm_image_orient_set(image, ELM_IMAGE_FLIP_HORIZONTAL);
64 elm_image_aspect_fixed_set(image, EINA_TRUE);
65 elm_image_fill_outside_set(image, EINA_TRUE);
66 elm_image_editable_set(image, EINA_TRUE);
67 evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
68 elm_win_resize_object_add(win, image);
69 evas_object_show(image);
73 elm_main(int argc, char **argv)
77 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
80 evas_object_show(win);