2 * Tested interface: AtkAction
4 * Tested AtkObject: EailPhotocam
6 * Description: Test AtkAction interface
8 * Test input: accessible object representing EailPhotocam
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
15 #include "eail_test_utils.h"
17 #define ACTIONS_NUMBER 7
19 static int action_test_passed;
21 INIT_TEST("EailPhotocam")
24 _on_photocam_clicked(void *data, Evas_Object *obj, void *ev)
26 action_test_passed = 1;
30 _do_test(AtkObject *obj)
32 g_assert(ATK_IS_ACTION(obj));
34 g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
36 eailu_test_action_activate(ATK_ACTION(obj), "click");
38 g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
40 eailu_test_action_description_all(ATK_ACTION(obj));
42 for (int count = 0; ACTIONS_NUMBER > count; count++)
43 g_assert(atk_action_do_action(ATK_ACTION(obj), count));
45 g_assert(action_test_passed);
47 eailu_test_code_called = 1;
51 _init_photocam(Evas_Object *win)
53 Evas_Object *bg, *photocam;
54 const char * const filename = "./data/whiterabbit01.jpg";
57 elm_bg_color_set(bg, 255, 255, 255);
58 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
59 elm_win_resize_object_add(win, bg);
62 photocam = elm_photocam_add(win);
63 g_assert(EVAS_LOAD_ERROR_NONE == elm_photocam_file_set(photocam, filename));
64 elm_scroller_bounce_set(photocam, EINA_FALSE, EINA_TRUE);
65 evas_object_resize(photocam, 300, 300);
66 evas_object_show(photocam);
67 evas_object_smart_callback_add(photocam, "clicked", _on_photocam_clicked, NULL);
71 elm_main(int argc, char **argv)
75 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
78 evas_object_show(win);