2 * Tested interface: AtkAction
4 * Tested AtkObject: EailFileselectorEntry
6 * Description: Test AtkAction interface
8 * Test input: accessible object representing EailFileselectorEntry
10 * Expected test result: test should return 0 (success)
13 #include <Elementary.h>
16 #include "eail_test_utils.h"
18 #define EAIL_LABEL_FOR_FSE "Select a file"
20 INIT_TEST("EailFileselectorEntry")
23 _do_test(AtkObject *obj)
27 _printf("Testing FileselectorEntry instance....\n");
29 g_assert(ATK_IS_OBJECT(obj));
30 g_assert(ATK_IS_ACTION(obj));
32 actions_num = atk_action_get_n_actions(ATK_ACTION(obj) );
33 g_assert(4 == actions_num);
35 eailu_test_atk_focus(obj, TRUE);
37 /* checking if all needed actions are implemented */
39 eailu_test_action_activate(ATK_ACTION(obj), "press");
42 eailu_test_action_activate(ATK_ACTION(obj), "longpress");
45 eailu_test_action_activate(ATK_ACTION(obj), "release");
48 eailu_test_action_activate(ATK_ACTION(obj), "click");
50 /* test for non-existing action */
51 g_assert((eailu_get_action_number(ATK_ACTION(obj), "typo")) == -1);
53 /* test set/get action description */
54 eailu_test_action_description_all(ATK_ACTION(obj));
56 _printf("DONE. All FileselectorEntry test passed successfully \n");
58 eailu_test_code_called = 1;
62 _init_file_selector_button(Evas_Object *win)
64 Evas_Object *fs_entry, *vbox, *icon;
66 vbox = elm_box_add(win);
67 elm_win_resize_object_add(win, vbox);
68 evas_object_size_hint_weight_set(vbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
69 evas_object_show(vbox);
71 icon = elm_icon_add(win);
72 elm_icon_standard_set(icon, "file");
73 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
75 /* file selector entry */
76 fs_entry = elm_fileselector_entry_add(win);
77 evas_object_size_hint_align_set(fs_entry, EVAS_HINT_FILL, 0);
78 elm_fileselector_entry_path_set(fs_entry, "/tmp");
79 elm_object_text_set(fs_entry, EAIL_LABEL_FOR_FSE);
80 elm_object_part_content_set(fs_entry, "button icon", icon);
82 elm_box_pack_end(vbox, fs_entry);
83 evas_object_show(fs_entry);
84 evas_object_resize(win, 300, 300);
88 elm_main(int argc, char **argv)
92 win = eailu_create_test_window_with_glib_init(_on_done, _on_focus_in);
93 _init_file_selector_button(win);
95 evas_object_show(win);