Title: [127422] trunk/Source/WebKit2
Revision
127422
Author
[email protected]
Date
2012-09-03 07:48:45 -0700 (Mon, 03 Sep 2012)

Log Message

[EFL][WK2] Add ewk_settings.
https://bugs.webkit.org/show_bug.cgi?id=91206

Patch by Eunmi Lee <[email protected]> on 2012-09-03
Reviewed by Gyuyoung Kim.

Add the ewk_settings which wraps the WKPreferencesRef.
The ewk_settings will be created by the ewk_view and it will be
destroyed when the ewk_view is destroyed. I make each view to have
its own group to make one ewk_settings sets preferences only for
one ewk_view.
The application can get the ewk_settings from ewk_view using
ewk_view_settings_get() API.

* UIProcess/API/efl/EWebKit2.h:
* UIProcess/API/efl/ewk_settings.cpp: Added.
(ewk_settings_enable_scripts_set):
(ewk_settings_enable_scripts_get):
(ewk_settings_auto_load_images_set):
(ewk_settings_auto_load_images_get):
* UIProcess/API/efl/ewk_settings.h: Added.
* UIProcess/API/efl/ewk_settings_private.h: Added.
(_Ewk_Settings):
(_Ewk_Settings::_Ewk_Settings):
* UIProcess/API/efl/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_ewk_view_initialize):
(ewk_view_settings_get):
* UIProcess/API/efl/ewk_view.h:
* UIProcess/API/efl/tests/test_ewk2_settings.cpp: Added.
(TEST_F):
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (127421 => 127422)


--- trunk/Source/WebKit2/ChangeLog	2012-09-03 14:41:42 UTC (rev 127421)
+++ trunk/Source/WebKit2/ChangeLog	2012-09-03 14:48:45 UTC (rev 127422)
@@ -1,3 +1,38 @@
+2012-09-03  Eunmi Lee  <[email protected]>
+
+        [EFL][WK2] Add ewk_settings.
+        https://bugs.webkit.org/show_bug.cgi?id=91206
+
+        Reviewed by Gyuyoung Kim.
+
+        Add the ewk_settings which wraps the WKPreferencesRef.
+        The ewk_settings will be created by the ewk_view and it will be
+        destroyed when the ewk_view is destroyed. I make each view to have
+        its own group to make one ewk_settings sets preferences only for
+        one ewk_view.
+        The application can get the ewk_settings from ewk_view using
+        ewk_view_settings_get() API.
+
+        * UIProcess/API/efl/EWebKit2.h:
+        * UIProcess/API/efl/ewk_settings.cpp: Added.
+        (ewk_settings_enable_scripts_set):
+        (ewk_settings_enable_scripts_get):
+        (ewk_settings_auto_load_images_set):
+        (ewk_settings_auto_load_images_get):
+        * UIProcess/API/efl/ewk_settings.h: Added.
+        * UIProcess/API/efl/ewk_settings_private.h: Added.
+        (_Ewk_Settings):
+        (_Ewk_Settings::_Ewk_Settings):
+        * UIProcess/API/efl/ewk_view.cpp:
+        (_Ewk_View_Private_Data):
+        (_ewk_view_initialize):
+        (ewk_view_settings_get):
+        * UIProcess/API/efl/ewk_view.h:
+        * UIProcess/API/efl/tests/test_ewk2_settings.cpp: Added.
+        (TEST_F):
+        * UIProcess/API/efl/tests/test_ewk2_view.cpp:
+        (TEST_F):
+
 2012-09-03  Allan Sandfeld Jensen  <[email protected]>
 
         Wheel-events fails temporarily after reload

Modified: trunk/Source/WebKit2/PlatformEfl.cmake (127421 => 127422)


--- trunk/Source/WebKit2/PlatformEfl.cmake	2012-09-03 14:41:42 UTC (rev 127421)
+++ trunk/Source/WebKit2/PlatformEfl.cmake	2012-09-03 14:48:45 UTC (rev 127422)
@@ -60,6 +60,7 @@
     UIProcess/API/efl/ewk_main.cpp
     UIProcess/API/efl/ewk_navigation_policy_decision.cpp
     UIProcess/API/efl/ewk_popup_menu_item.cpp
+    UIProcess/API/efl/ewk_settings.cpp
     UIProcess/API/efl/ewk_url_request.cpp
     UIProcess/API/efl/ewk_url_response.cpp
     UIProcess/API/efl/ewk_url_scheme_request.cpp
@@ -214,6 +215,7 @@
     "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_main.h"
     "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_navigation_policy_decision.h"
     "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_popup_menu_item.h"
+    "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_settings.h"
     "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_request.h"
     "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_response.h"
     "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_scheme_request.h"
@@ -279,6 +281,7 @@
     test_ewk2_download_job
     test_ewk2_eina_shared_string
     test_ewk2_intents
+    test_ewk2_settings
     test_ewk2_view
 )
 

Modified: trunk/Source/WebKit2/UIProcess/API/efl/EWebKit2.h (127421 => 127422)


--- trunk/Source/WebKit2/UIProcess/API/efl/EWebKit2.h	2012-09-03 14:41:42 UTC (rev 127421)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EWebKit2.h	2012-09-03 14:48:45 UTC (rev 127422)
@@ -39,6 +39,7 @@
 #include "ewk_main.h"
 #include "ewk_navigation_policy_decision.h"
 #include "ewk_popup_menu_item.h"
+#include "ewk_settings.h"
 #include "ewk_url_request.h"
 #include "ewk_url_response.h"
 #include "ewk_url_scheme_request.h"

Added: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp (0 => 127422)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp	2012-09-03 14:48:45 UTC (rev 127422)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ewk_settings.h"
+
+#include "ewk_settings_private.h"
+#include <WebKit2/WKPreferences.h>
+
+using namespace WebKit;
+
+Eina_Bool ewk_settings_javascript_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    WKPreferencesSetJavaScriptEnabled(settings->preferences.get(), enable);
+
+    return true;
+}
+
+Eina_Bool ewk_settings_javascript_enabled_get(const Ewk_Settings* settings)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    return WKPreferencesGetJavaScriptEnabled(settings->preferences.get());
+}
+
+Eina_Bool ewk_settings_loads_images_automatically_set(Ewk_Settings* settings, Eina_Bool automatic)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    WKPreferencesSetLoadsImagesAutomatically(settings->preferences.get(), automatic);
+
+    return true;
+}
+
+Eina_Bool ewk_settings_loads_images_automatically_get(const Ewk_Settings* settings)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    return WKPreferencesGetLoadsImagesAutomatically(settings->preferences.get());
+}

Added: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h (0 => 127422)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h	2012-09-03 14:48:45 UTC (rev 127422)
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file    ewk_settings.h
+ * @brief   Describes the settings API.
+ *
+ * @note The ewk_settings is for setting the preference of specific ewk_view.
+ * We can get the ewk_settings from ewk_view using ewk_view_settings_get() API.
+ */
+
+#ifndef ewk_settings_h
+#define ewk_settings_h
+
+#include <Eina.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Creates a type name for _Ewk_Settings */
+typedef struct _Ewk_Settings Ewk_Settings;
+
+/**
+ * Enables/disables the _javascript_ executing.
+ *
+ * @param settings settings object to set _javascript_ executing
+ * @param enable @c EINA_TRUE to enable _javascript_ executing
+ *        @c EINA_FALSE to disable
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
+ */
+EAPI Eina_Bool ewk_settings_javascript_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
+
+/**
+ * Returns the _javascript_ can be executable or not.
+ *
+ * @param settings settings object to query if the _javascript_ can be executed
+ *
+ * @return @c EINA_TRUE if the _javascript_ can be executed
+ *         @c EINA_FALSE if not or on failure
+ */
+EAPI Eina_Bool ewk_settings_javascript_enabled_get(const Ewk_Settings *settings);
+
+/**
+ * Enables/disables auto loading of the images.
+ *
+ * @param settings settings object to set auto loading of the images
+ * @param automatic @c EINA_TRUE to enable auto loading of the images,
+ *        @c EINA_FALSE to disable
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
+ */
+EAPI Eina_Bool ewk_settings_loads_images_automatically_set(Ewk_Settings *settings, Eina_Bool automatic);
+
+/**
+ * Returns the images can be loaded automatically or not.
+ *
+ * @param settings settings object to get auto loading of the images
+ *
+ * @return @c EINA_TRUE if the images are loaded automatically,
+ *         @c EINA_FALSE if not or on failure
+ */
+EAPI Eina_Bool ewk_settings_loads_images_automatically_get(const Ewk_Settings *settings);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_settings_h

Added: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings_private.h (0 => 127422)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings_private.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings_private.h	2012-09-03 14:48:45 UTC (rev 127422)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ewk_settings_private_h
+#define ewk_settings_private_h
+
+#include "ewk_settings.h"
+#include <WebKit2/WKPreferences.h>
+#include <WebKit2/WKRetainPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+/** Creates a type name for _Ewk_Settings */
+typedef struct _Ewk_Settings Ewk_Settings;
+
+/**
+ * \struct  _Ewk_Settings
+ * @brief   Contains the settings data.
+ */
+struct _Ewk_Settings {
+    WKRetainPtr<WKPreferencesRef> preferences;
+
+    explicit _Ewk_Settings(WKPreferencesRef wkPreferences)
+        : preferences(wkPreferences)
+    { }
+};
+
+#endif // ewk_settings_private_h

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (127421 => 127422)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-09-03 14:41:42 UTC (rev 127421)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-09-03 14:48:45 UTC (rev 127422)
@@ -32,6 +32,7 @@
 #include "WKString.h"
 #include "WKURL.h"
 #include "WebContext.h"
+#include "WebPageGroup.h"
 #include "WebPopupItem.h"
 #include "WebPopupMenuProxyEfl.h"
 #include "ewk_back_forward_list_private.h"
@@ -41,6 +42,7 @@
 #include "ewk_popup_menu_item.h"
 #include "ewk_popup_menu_item_private.h"
 #include "ewk_private.h"
+#include "ewk_settings_private.h"
 #include "ewk_view_find_client_private.h"
 #include "ewk_view_form_client_private.h"
 #include "ewk_view_loader_client_private.h"
@@ -53,6 +55,7 @@
 #include <Edje.h>
 #include <WebCore/Cursor.h>
 #include <WebCore/EflScreenUtilities.h>
+#include <WebKit2/WKPageGroup.h>
 #include <wtf/text/CString.h>
 
 #if USE(ACCELERATED_COMPOSITING)
@@ -88,6 +91,7 @@
     Evas_Object* cursorObject;
     LoadingResourcesMap loadingResourcesMap;
     Ewk_Back_Forward_List* backForwardList;
+    OwnPtr<Ewk_Settings> settings;
 
     WebPopupMenuProxyEfl* popupMenuProxy;
     Eina_List* popupMenuItems;
@@ -685,7 +689,10 @@
 
     priv->pageClient = PageClientImpl::create(ewkView);
 
-    priv->pageProxy = toImpl(ewk_context_WKContext_get(context))->createWebPage(priv->pageClient.get(), toImpl(pageGroupRef));
+    if (pageGroupRef)
+        priv->pageProxy = toImpl(ewk_context_WKContext_get(context))->createWebPage(priv->pageClient.get(), toImpl(pageGroupRef));
+    else
+        priv->pageProxy = toImpl(ewk_context_WKContext_get(context))->createWebPage(priv->pageClient.get(), WebPageGroup::create().get());
 #if USE(COORDINATED_GRAPHICS)
     priv->pageProxy->pageGroup()->preferences()->setAcceleratedCompositingEnabled(true);
     priv->pageProxy->pageGroup()->preferences()->setForceCompositingMode(true);
@@ -694,6 +701,7 @@
     priv->pageProxy->initializeWebPage();
 
     priv->backForwardList = ewk_back_forward_list_new(toAPI(priv->pageProxy->backForwardList()));
+    priv->settings = adoptPtr(new Ewk_Settings(WKPageGroupGetPreferences(WKPageGetPageGroup(toAPI(priv->pageProxy.get())))));
 
 #if USE(COORDINATED_GRAPHICS)
     priv->viewportHandler = EflViewportHandler::create(ewkView);
@@ -851,6 +859,14 @@
     return true;
 }
 
+Ewk_Settings* ewk_view_settings_get(const Evas_Object* ewkView)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
+
+    return priv->settings.get();
+}
+
 /**
  * @internal
  * Load was initiated for a resource in the view.

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h (127421 => 127422)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h	2012-09-03 14:41:42 UTC (rev 127421)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.h	2012-09-03 14:48:45 UTC (rev 127422)
@@ -73,6 +73,7 @@
 #include "ewk_context.h"
 #include "ewk_download_job.h"
 #include "ewk_intent.h"
+#include "ewk_settings.h"
 #include "ewk_url_request.h"
 #include "ewk_url_response.h"
 #include "ewk_web_error.h"
@@ -356,6 +357,15 @@
 EAPI Eina_Bool    ewk_view_stop(Evas_Object *o);
 
 /**
+ * Gets the Ewk_Settings of this view.
+ *
+ * @param o view object to get Ewk_Settings
+ *
+ * @return the Ewk_Settings of this view or @c NULL on failure
+ */
+EAPI Ewk_Settings *ewk_view_settings_get(const Evas_Object *o);
+
+/**
  * Delivers a Web intent to the view's main frame.
  *
  * @param o view object to deliver the intent to

Added: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp (0 => 127422)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp	2012-09-03 14:48:45 UTC (rev 127422)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "UnitTestUtils/EWK2UnitTestBase.h"
+#include <EWebKit2.h>
+#include <Eina.h>
+
+using namespace EWK2UnitTest;
+
+TEST_F(EWK2UnitTestBase, ewk_settings_javascript_enabled)
+{
+    Ewk_Settings* settings = ewk_view_settings_get(webView());
+
+    ASSERT_TRUE(ewk_settings_javascript_enabled_set(settings, EINA_TRUE));
+    ASSERT_TRUE(ewk_settings_javascript_enabled_get(settings));
+
+    ASSERT_TRUE(ewk_settings_javascript_enabled_set(settings, 2));
+    ASSERT_TRUE(ewk_settings_javascript_enabled_get(settings));
+
+    ASSERT_TRUE(ewk_settings_javascript_enabled_set(settings, EINA_FALSE));
+    ASSERT_FALSE(ewk_settings_javascript_enabled_get(settings));
+}
+
+TEST_F(EWK2UnitTestBase, ewk_settings_loads_images_automatically)
+{
+    Ewk_Settings* settings = ewk_view_settings_get(webView());
+
+    ASSERT_TRUE(ewk_settings_loads_images_automatically_set(settings, EINA_TRUE));
+    ASSERT_TRUE(ewk_settings_loads_images_automatically_get(settings));
+
+    ASSERT_TRUE(ewk_settings_loads_images_automatically_set(settings, 2));
+    ASSERT_TRUE(ewk_settings_loads_images_automatically_get(settings));
+
+    ASSERT_TRUE(ewk_settings_loads_images_automatically_set(settings, EINA_FALSE));
+    ASSERT_FALSE(ewk_settings_loads_images_automatically_get(settings));
+}

Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp (127421 => 127422)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp	2012-09-03 14:41:42 UTC (rev 127421)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp	2012-09-03 14:48:45 UTC (rev 127422)
@@ -236,3 +236,10 @@
     EXPECT_TRUE(ewk_view_popup_menu_close(webView()));
     EXPECT_FALSE(ewk_view_popup_menu_select(webView(), 0));
 }
+
+TEST_F(EWK2UnitTestBase, ewk_view_settings_get)
+{
+    Ewk_Settings* settings = ewk_view_settings_get(webView());
+    ASSERT_TRUE(settings);
+    ASSERT_EQ(settings, ewk_view_settings_get(webView()));
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to