Make TC for ewk_context_memory_saving_mode_set()
authorEunsol Park <eunsol47.park@samsung.com>
Mon, 25 Mar 2013 01:20:11 +0000 (10:20 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 8 Aug 2013 02:20:28 +0000 (02:20 +0000)
[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

TC/unit_test/webkit2/Makefile
TC/unit_test/webkit2/tslist
TC/unit_test/webkit2/utc_webkit2_ewk_context_memory_saving_mode_set_func.c [new file with mode: 0644]

index 2b70f90..16e9a14 100644 (file)
@@ -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 \
index 402a4ee..3a75ccc 100644 (file)
@@ -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 (file)
index 0000000..a8b29df
--- /dev/null
@@ -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 <eunsol47.park@samsung.com>
+ * @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();
+}