From: Eunsol Park Date: Mon, 25 Mar 2013 01:20:11 +0000 (+0900) Subject: Make TC for ewk_context_memory_saving_mode_set() X-Git-Tag: 2.2_release~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=a91b766e02419e4897c9be4970ad531220696f16;p=framework%2Fweb%2Fwebkit-efl.git Make TC for ewk_context_memory_saving_mode_set() [Title] Make TC for ewk_context_memory_saving_mode_set(). [Issue#] N/A [Problem] TC for ewk_context_memory_saving_mode_set() does not exist. [Cause] None. [Solution] Make TC for ewk_context_memory_saving_mode_set(). Change-Id: I12a1584009c1637f49127474aa0f1b798d7c43ee --- diff --git a/TC/unit_test/webkit2/Makefile b/TC/unit_test/webkit2/Makefile index 2b70f90..16e9a14 100644 --- a/TC/unit_test/webkit2/Makefile +++ b/TC/unit_test/webkit2/Makefile @@ -27,6 +27,7 @@ TARGETS = \ utc_webkit2_ewk_context_local_file_system_path_set_func \ utc_webkit2_ewk_context_memory_sampler_start_func \ utc_webkit2_ewk_context_memory_sampler_stop_func \ + utc_webkit2_ewk_context_memory_saving_mode_set_func \ utc_webkit2_ewk_context_menu_item_append_as_action_func \ utc_webkit2_ewk_context_menu_item_count_func \ utc_webkit2_ewk_context_menu_item_enabled_get_func \ diff --git a/TC/unit_test/webkit2/tslist b/TC/unit_test/webkit2/tslist index 402a4ee..3a75ccc 100644 --- a/TC/unit_test/webkit2/tslist +++ b/TC/unit_test/webkit2/tslist @@ -24,6 +24,7 @@ /unit_test/webkit2/utc_webkit2_ewk_context_local_file_system_path_set_func /unit_test/webkit2/utc_webkit2_ewk_context_memory_sampler_start_func /unit_test/webkit2/utc_webkit2_ewk_context_memory_sampler_stop_func +/unit_test/webkit2/utc_webkit2_ewk_context_memory_saving_mode_set_func /unit_test/webkit2/utc_webkit2_ewk_context_menu_item_append_as_action_func /unit_test/webkit2/utc_webkit2_ewk_context_menu_item_count_func /unit_test/webkit2/utc_webkit2_ewk_context_menu_item_enabled_get_func diff --git a/TC/unit_test/webkit2/utc_webkit2_ewk_context_memory_saving_mode_set_func.c b/TC/unit_test/webkit2/utc_webkit2_ewk_context_memory_saving_mode_set_func.c new file mode 100644 index 0000000..a8b29df --- /dev/null +++ b/TC/unit_test/webkit2/utc_webkit2_ewk_context_memory_saving_mode_set_func.c @@ -0,0 +1,65 @@ +/* + * WebKit2 EFL + * + * Copyright (c) 2012 Samsung Electronics Co., Ltd. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/** + * @file utc_webkit2_ewk_context_memory_saving_mode_set_func.c + * @author Eunsol Park + * @date 2013-08-06 + * @brief Tests EWK function ewk_context_memory_saving_mode_set() + */ + +/* Define those macros _before_ you include the utc_webkit2_ewk.h header file. */ +#define TESTED_FUN_NAME ewk_context_memory_saving_mode_set +#define POSITIVE_TEST_FUN_NUM 1 +#define NEGATIVE_TEST_FUN_NUM 1 + +#include "utc_webkit2_ewk.h" + +/* Startup and cleanup functions */ +static void startup(void) +{ + utc_webkit2_ewk_test_init(); +} + +static void cleanup(void) +{ + utc_webkit2_ewk_test_end(); +} + +/** + * @brief Tests whether the function works properly for case Memory saving mode set true + */ +POS_TEST_FUN(1) +{ + Ewk_Context* context = ewk_view_context_get(test_view.webview); + ewk_context_memory_saving_mode_set(context, EINA_TRUE); + uts_pass(); +} + +/** + * @brief Tests whether the function works properly for case Memory saving mode set false + */ +NEG_TEST_FUN(1) +{ + Ewk_Context* context = ewk_view_context_get(test_view.webview); + ewk_context_memory_saving_mode_set(context, EINA_FALSE); + uts_pass(); +}