2 * Tested interface: AtkAction
4 * Tested AtkObject: EailCtxpopup
6 * Description: Test AtkAction interface
8 * Test input: accessible object representing EailCtxpopup
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 INIT_TEST("EailCtxpopup")
23 _do_test(AtkObject *obj)
25 _printf("Testing ctxpopup instance....\n");
27 g_assert(ATK_IS_ACTION(obj));
28 g_assert(ACTIONS_NUMBER == atk_action_get_n_actions(ATK_ACTION(obj)));
29 eailu_test_action_activate(ATK_ACTION(obj), "dismiss");
30 g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
31 eailu_test_action_description_all(ATK_ACTION(obj));
33 _printf("Tests passed successfully\n");
35 eailu_test_code_called = 1;
39 _ctxpopup_item_cb(void *data, Evas_Object *obj, void *event_info)
41 _printf("ctxpopup item selected: %s\n", elm_object_item_text_get(event_info));
44 Elm_Object_Item *item_new(Evas_Object *ctxpopup, const char * label, const char *icon)
46 Evas_Object *ic = elm_icon_add(ctxpopup);
47 elm_icon_standard_set(ic, icon);
48 elm_image_resizable_set(ic, EINA_FALSE, EINA_FALSE);
49 return elm_ctxpopup_item_append(ctxpopup, label, ic, _ctxpopup_item_cb, NULL);
53 _init_ctxpopup(Evas_Object *win)
55 Evas_Object *ctxpopup, *box;
56 Elm_Object_Item *object_it;
58 box = elm_box_add(win);
59 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
60 elm_win_resize_object_add(win, box);
61 evas_object_show(box);
63 ctxpopup = elm_ctxpopup_add(win);
64 item_new(ctxpopup, "Go to home folder", "home");
65 item_new(ctxpopup, "Save file", "file");
66 item_new(ctxpopup, "Delete file", "delete");
67 object_it = item_new(ctxpopup, "Navigate to folder", "folder");
68 elm_object_item_disabled_set(object_it, EINA_TRUE);
69 item_new(ctxpopup, "Edit entry", "edit");
70 object_it = item_new(ctxpopup, "Set date and time", "clock");
72 evas_object_size_hint_weight_set(ctxpopup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
73 evas_object_show(ctxpopup);
74 elm_box_pack_end(box, ctxpopup);
78 elm_main(int argc, char **argv)
82 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
84 evas_object_show(win);