4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
\r
6 * This library is free software; you can redistribute it and/or modify it under
\r
7 * the terms of the GNU Lesser General Public License as published by the
\r
8 * Free Software Foundation; either version 2.1 of the License, or (at your option)
\r
11 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
\r
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
\r
14 * License for more details.
\r
16 * You should have received a copy of the GNU Lesser General Public License
\r
17 * along with this library; if not, write to the Free Software Foundation, Inc., 51
\r
18 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
\r
22 /* Define those macros _before_ you include the utc_webkit_ewk.h header file. */
\r
23 #define TESTED_FUN_NAME ewk_view_title_get
\r
24 #define POSITIVE_TEST_FUN_NUM 1
\r
25 #define NEGATIVE_TEST_FUN_NUM 1
\r
27 #include "utc_webkit2_ewk.h"
\r
33 #define SAMPLE_HTML_FILE ("/common/sample.html")
\r
34 #define TITLE0 "Test file"
\r
36 /*Callback for load finished */
\r
37 static void loadFinished(void *data, Evas_Object *webview, void *arg)
\r
39 utc_message("[loadFinished] :: \n");
\r
40 utc_webkit2_main_loop_quit();
\r
43 /* Callback for load error */
\r
44 static void loadError(void* data, Evas_Object* webview, void* event_info)
\r
46 utc_message("[loadError] :: \n");
\r
47 utc_webkit2_main_loop_quit();
\r
52 /* Startup and cleanup functions */
\r
53 static void startup(void)
\r
55 utc_webkit2_ewk_test_init();
\r
56 evas_object_smart_callback_add(test_view.webview, "load,finished", loadFinished, NULL);
\r
57 evas_object_smart_callback_add(test_view.webview, "load,error", loadError, NULL);
\r
60 static void cleanup(void)
\r
62 evas_object_smart_callback_del(test_view.webview, "load,finished", loadFinished);
\r
63 evas_object_smart_callback_del(test_view.webview, "load,error", loadError);
\r
64 utc_webkit2_ewk_test_end();
\r
67 /*Load Specified URL*/
\r
68 static void loadURL(const char* url)
\r
70 char* full_path = generate_full_resource_path(url);
\r
74 Eina_Bool result = ewk_view_url_set(test_view.webview, full_path);
\r
82 * @brief Checks title when page is loaded.
\r
86 loadURL(SAMPLE_HTML_FILE);
\r
87 utc_webkit2_main_loop_begin();
\r
89 const char* title0 = ewk_view_title_get(test_view.webview);
\r
90 utc_check_str_eq(title0, TITLE0);
\r
94 * @brief Checking title when ewk_view is NULL.
\r
98 const char* title = ewk_view_title_get(NULL);
\r
99 utc_check_eq(title, NULL);
\r