Merge "Add to ewk api for setting/getting the User Agent by using system info library...
authorSeung Hak Lee <s.hak.lee@review.tizendev.org>
Thu, 8 Aug 2013 04:37:43 +0000 (04:37 +0000)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 8 Aug 2013 04:37:43 +0000 (04:37 +0000)
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
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 3b55cd7..9916c80 100755 (executable)
@@ -205,8 +205,10 @@ void PageClientImpl::updateViewportSize(const IntSize& viewportSize, const int a
 
 void PageClientImpl::updateVisibleContentRectSize(const IntSize& size)
 {
-    // update visible content rect's size
+    // update visible content rect's size and scroll position
     m_visibleContentRect.setSize(size);
+    m_visibleContentRect = adjustVisibleContentRect(m_visibleContentRect, m_scaleFactor);
+    m_viewImpl->setScrollPosition(m_visibleContentRect.location());
 }
 #endif
 
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();
+}