2 * Tested interface: AtkAction
4 * Tested AtkObject: EailPhoto
6 * Description: Test AtkAction interface
8 * Test input: accessible object representing EailPhoto
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 #define ACTIONS_NUMBER 1
20 /* used for checking if photo was really clicked*/
21 static gboolean glob_test_photo_clicked = FALSE;
23 INIT_TEST("EailPhoto")
26 _clicked_cb(void *data , Evas_Object *obj,
29 glob_test_photo_clicked = TRUE;
33 _do_test(AtkObject *obj)
35 g_assert(ATK_IS_ACTION(obj));
37 g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
39 eailu_test_action_activate(ATK_ACTION(obj), "click");
41 g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
43 eailu_test_action_description_all(ATK_ACTION(obj));
45 g_assert(glob_test_photo_clicked);
47 eailu_test_code_called = 1;
51 _init_photo(Evas_Object *win)
53 Evas_Object *bx, *photo;
54 const char * const filename = "data/th-whiterabbit01.jpg";
56 bx = elm_box_add(win);
57 elm_box_horizontal_set(bx, EINA_TRUE);
58 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
59 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
60 elm_box_homogeneous_set(bx, EINA_TRUE);
61 elm_win_resize_object_add(win, bx);
63 photo = elm_photo_add(win);
64 evas_object_smart_callback_add(photo, "clicked", _clicked_cb, NULL);
65 g_assert(elm_photo_file_set(photo, filename));
66 elm_photo_size_set(photo, 100);
67 elm_photo_aspect_fixed_set(photo, EINA_FALSE);
68 evas_object_size_hint_weight_set(photo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
69 elm_photo_fill_inside_set(photo, EINA_TRUE);
70 evas_object_size_hint_align_set(photo, EVAS_HINT_FILL, EVAS_HINT_FILL);
71 elm_box_pack_end(bx, photo);
72 evas_object_show(photo);
78 elm_main(int argc, char **argv)
82 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
85 evas_object_show(win);