4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * This library is free software; you can redistribute it and/or modify it under
7 * the terms of the GNU Lesser General Public License as published by the
8 * Free Software Foundation; either version 2.1 of the License, or (at your option)
11 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 * License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this library; if not, write to the Free Software Foundation, Inc., 51
18 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 * @file utc_webkit2_ewk_hit_test_tag_name_get_func.c
24 * @author Yuni Jeong <yhnet.jung@samsung.com>
26 * @brief Tests EWK function ewk_hit_test_tag_name_get()
29 /* Define those macros _before_ you include the utc_webkit2_ewk.h header file. */
30 #define TESTED_FUN_NAME ewk_hit_test_tag_name_get
31 #define POSITIVE_TEST_FUN_NUM 1
32 #define NEGATIVE_TEST_FUN_NUM 1
34 #include "utc_webkit2_ewk.h"
36 static Eina_Bool is_failed = EINA_FALSE;
38 static void load_finished(void* data, Evas_Object* webview, void* event_info)
40 utc_message("[load_finished] :: \n");
41 is_failed = EINA_FALSE;
42 utc_webkit2_main_loop_quit();
45 static void load_error(void* data, Evas_Object* webview, void* event_info)
47 utc_message("[load_error] :: \n");
48 is_failed = EINA_TRUE;
49 utc_webkit2_main_loop_quit();
52 /* Startup and cleanup functions */
53 static void startup(void)
55 utc_webkit2_ewk_test_init();
57 evas_object_smart_callback_add(test_view.webview, "load,finished", load_finished, NULL);
58 evas_object_smart_callback_add(test_view.webview, "load,error", load_error, NULL);
62 static void cleanup(void)
64 evas_object_smart_callback_del(test_view.webview, "load,finished", load_finished);
65 evas_object_smart_callback_del(test_view.webview, "load,error", load_error);
67 utc_webkit2_ewk_test_end();
71 * @brief Checking whether the tag name of hit element is returned properly.
75 char* full_path = generate_full_resource_path("/ewk_hit_test/index.html");
79 Eina_Bool result = ewk_view_url_set(test_view.webview, full_path);
83 utc_webkit2_main_loop_begin();
88 Ewk_Hit_Test* hit_test = ewk_view_hit_test_new(test_view.webview, 80, 100, EWK_HIT_TEST_MODE_NODE_DATA);
89 if (ewk_hit_test_tag_name_get(hit_test))
94 ewk_hit_test_free(hit_test);
95 utc_check_eq(result, EINA_TRUE);
99 * @brief Checking whether function works properly in case of NULL of a hit test instance.
103 utc_check_eq(ewk_hit_test_tag_name_get(NULL), 0);