Fixed a problem that remember popup does not disappear
[framework/web/webkit-efl.git] / TC / unit_test / webkit2 / utc_webkit2_ewk_context_application_cache_path_set_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_context_application_cache_path_set_func.c
24  * @author SangYong Park <sy302.park@samsung.com>
25  * @date 2012-06-12
26  * @brief Tests EWK function ewk_context_application_cache_path_set()
27  */
28
29 /* Define those macros _before_ you include the utc_webkit2_ewk.h header file. */
30 #define TESTED_FUN_NAME ewk_context_application_cache_path_set
31 #define POSITIVE_TEST_FUN_NUM 1
32 #define NEGATIVE_TEST_FUN_NUM 2
33
34 #include "utc_webkit2_ewk.h"
35
36 /* Startup and cleanup functions */
37 static void startup(void)
38 {
39     utc_webkit2_ewk_test_init();
40 }
41
42 static void cleanup(void)
43 {
44     utc_webkit2_ewk_test_end();
45 }
46
47 static const char* cachePath = "./tempCachePath";
48
49 /**
50  * @brief Tests if can set application cache path.
51  */
52 POS_TEST_FUN(1)
53 {
54     Ewk_Context* context = ewk_view_context_get(test_view.webview);
55
56     if (!ewk_context_application_cache_path_set(context, cachePath))
57         utc_fail();
58
59     utc_message("Skip to test result because application cache store to storage asynchronous.\n");
60     utc_pass();
61 }
62
63 /**
64  * @brief Tests if returns false which context was null.
65  */
66 NEG_TEST_FUN(1)
67 {
68     utc_check_eq(ewk_context_application_cache_path_set(0, cachePath), EINA_FALSE);
69 }
70
71 /**
72  * @brief Tests if returns false which path was null.
73  */
74 NEG_TEST_FUN(2)
75 {
76     Ewk_Context* context = ewk_view_context_get(test_view.webview);
77     utc_check_eq(ewk_context_application_cache_path_set(context, 0), EINA_FALSE);
78 }