Fixed a problem that remember popup does not disappear
[framework/web/webkit-efl.git] / TC / unit_test / webkit2 / utc_webkit2_ewk_view_theme_get_func.c
1 /*
2  * WebKit2 EFL
3  *
4  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5  *
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)
9  * any later version.
10  *
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.
15  *
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
19  *
20  */
21
22 /**
23  * @file utc_webkit2_ewk_view_theme_get_func.c
24  * @author Yuni Jeong <yhnet.jung@samsung.com>
25  * @date 2012-06-22
26  * @brief Tests EWK function ewk_view_theme_get()
27  */
28
29 /* Define those macros _before_ you include the utc_webkit2_ewk.h header file. */
30 #define TESTED_FUN_NAME ewk_view_theme_get
31  #define POSITIVE_TEST_FUN_NUM 1
32 #define NEGATIVE_TEST_FUN_NUM 1
33
34 #include "utc_webkit2_ewk.h"
35
36 #define THEME_PATH "/ewk_view/webkit.edj"
37
38 /* Startup and cleanup functions */
39 static void startup(void)
40 {
41     utc_webkit2_ewk_test_init();
42 }
43
44 static void cleanup(void)
45 {
46     utc_webkit2_ewk_test_end();
47 }
48
49 /**
50  * @brief hecking whether the theme path is returned properly.
51  */
52 POS_TEST_FUN(1)
53 {
54     char* full_path = generate_full_resource_path(THEME_PATH);
55     if (!full_path)
56         utc_fail();
57
58     ewk_view_theme_set(test_view.webview, full_path);
59     Eina_Bool result;
60     if (strcmp(ewk_view_theme_get(test_view.webview), full_path) == 0)
61         result = EINA_TRUE;
62     else
63         result = EINA_FALSE;
64     free(full_path);
65
66     utc_check_eq(result, EINA_TRUE);
67 }
68
69 /**
70  * @brief Checking whether function works properly in case of NULL of a webview.
71  */
72 NEG_TEST_FUN(1)
73 {
74     utc_check_eq(ewk_view_theme_get(NULL), 0);
75 }