Remove testRunner.disableImageLoading()
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Dec 2012 18:14:35 +0000 (18:14 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 9 Dec 2012 18:14:35 +0000 (18:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=98083

Reviewed by Gustavo Noronha Silva.

Remove the disableImageLoading methods and callback.
No tests use the method anymore and all ports except Wx
now support this behavior through overriding the
WebKitDisplayImagesKey preference.

* DumpRenderTree/TestRunner.cpp:
(TestRunner::staticFunctions):
* DumpRenderTree/TestRunner.h:
(TestRunner):
* DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
(TestRunner::overridePreference): Add support for overriding the
WebKitDisplayImagesKey preference which is now the preferred way
of disabling image loading.
* DumpRenderTree/efl/TestRunnerEfl.cpp:
* DumpRenderTree/gtk/TestRunnerGtk.cpp:
* DumpRenderTree/mac/TestRunnerMac.mm:
* DumpRenderTree/qt/TestRunnerQt.cpp:
* DumpRenderTree/qt/TestRunnerQt.h:
(TestRunner):
* DumpRenderTree/win/TestRunnerWin.cpp:
* DumpRenderTree/wx/TestRunnerWx.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137080 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/DumpRenderTree/TestRunner.cpp
Tools/DumpRenderTree/TestRunner.h
Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp
Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp
Tools/DumpRenderTree/mac/TestRunnerMac.mm
Tools/DumpRenderTree/qt/TestRunnerQt.cpp
Tools/DumpRenderTree/qt/TestRunnerQt.h
Tools/DumpRenderTree/win/TestRunnerWin.cpp
Tools/DumpRenderTree/wx/TestRunnerWx.cpp

index ad33a9c..69ec179 100644 (file)
@@ -1,3 +1,32 @@
+2012-12-09  Zan Dobersek  <zandobersek@gmail.com>
+
+        Remove testRunner.disableImageLoading()
+        https://bugs.webkit.org/show_bug.cgi?id=98083
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Remove the disableImageLoading methods and callback.
+        No tests use the method anymore and all ports except Wx
+        now support this behavior through overriding the
+        WebKitDisplayImagesKey preference.
+
+        * DumpRenderTree/TestRunner.cpp:
+        (TestRunner::staticFunctions):
+        * DumpRenderTree/TestRunner.h:
+        (TestRunner):
+        * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp:
+        (TestRunner::overridePreference): Add support for overriding the
+        WebKitDisplayImagesKey preference which is now the preferred way
+        of disabling image loading.
+        * DumpRenderTree/efl/TestRunnerEfl.cpp:
+        * DumpRenderTree/gtk/TestRunnerGtk.cpp:
+        * DumpRenderTree/mac/TestRunnerMac.mm:
+        * DumpRenderTree/qt/TestRunnerQt.cpp:
+        * DumpRenderTree/qt/TestRunnerQt.h:
+        (TestRunner):
+        * DumpRenderTree/win/TestRunnerWin.cpp:
+        * DumpRenderTree/wx/TestRunnerWx.cpp:
+
 2012-12-09  Joanmarie Diggs  <jdiggs@igalia.com>
 
         [GTK] accessibility/label-for-control-hittest.html is failing
index 046f76b..f9fff44 100644 (file)
@@ -548,15 +548,6 @@ static JSValueRef decodeHostNameCallback(JSContextRef context, JSObjectRef funct
     return JSValueMakeString(context, decodedHostName.get());
 }
 
-static JSValueRef disableImageLoadingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
-    // Has mac implementation, needs windows implementation
-    TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject));
-    controller->disableImageLoading();
-    
-    return JSValueMakeUndefined(context);
-}
-
 static JSValueRef dispatchPendingLoadRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     // Has mac implementation, needs windows implementation
@@ -2209,7 +2200,6 @@ JSStaticFunction* TestRunner::staticFunctions()
         { "computedStyleIncludingVisitedInfo", computedStyleIncludingVisitedInfoCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "decodeHostName", decodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "deliverWebIntent", deliverWebIntentCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
-        { "disableImageLoading", disableImageLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "disallowIncreaseForApplicationCacheQuota", disallowIncreaseForApplicationCacheQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "dispatchPendingLoadRequests", dispatchPendingLoadRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "display", displayCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
index a952781..6795cae 100644 (file)
@@ -57,7 +57,6 @@ public:
     JSStringRef copyDecodedHostName(JSStringRef name);
     JSStringRef copyEncodedHostName(JSStringRef name);
     void deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data);
-    void disableImageLoading();
     void dispatchPendingLoadRequests();
     void display();
     void displayInvalidatedRegion();
index 6eeac38..2b1cef6 100644 (file)
@@ -415,11 +415,6 @@ void TestRunner::removeAllVisitedLinks()
     notImplemented();
 }
 
-void TestRunner::disableImageLoading()
-{
-    BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setLoadsImagesAutomatically(false);
-}
-
 void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
 {
     if (!mainFrame)
@@ -440,6 +435,8 @@ void TestRunner::overridePreference(JSStringRef key, JSStringRef value)
         BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setWebSocketsEnabled(valueStr == "true" || valueStr == "1");
     else if (keyStr == "WebKitDefaultTextEncodingName")
         BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setDefaultTextEncodingName(valueStr);
+    else if (keyStr == "WebKitDisplayImagesKey")
+        BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setLoadsImagesAutomatically(valueStr == "true" || valueStr == "1");
 }
 
 void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
index de40034..17faf48 100644 (file)
@@ -353,11 +353,6 @@ void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool
     DumpRenderTreeSupportEfl::setAutofilled(context, nodeObject, autofilled);
 }
 
-void TestRunner::disableImageLoading()
-{
-    ewk_view_setting_auto_load_images_set(browser->mainView(), EINA_FALSE);
-}
-
 void TestRunner::setMockDeviceOrientation(bool, double, bool, double, bool, double)
 {
     // FIXME: Implement for DeviceOrientation layout tests.
index e887ca1..c04ba36 100644 (file)
@@ -415,15 +415,6 @@ void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool
     DumpRenderTreeSupportGtk::setAutofilled(context, nodeObject, isAutofilled);
 }
 
-void TestRunner::disableImageLoading()
-{
-    WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
-    ASSERT(view);
-
-    WebKitWebSettings* settings = webkit_web_view_get_settings(view);
-    g_object_set(G_OBJECT(settings), "auto-load-images", FALSE, NULL);
-}
-
 void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
 {
     // FIXME: Implement for DeviceOrientation layout tests.
index 7ab216b..98afa51 100644 (file)
@@ -631,11 +631,6 @@ void TestRunner::setViewModeMediaFeature(JSStringRef mode)
     // FIXME: implement
 }
 
-void TestRunner::disableImageLoading()
-{
-    [[WebPreferences standardPreferences] setLoadsImagesAutomatically:NO];
-}
-
 void TestRunner::dispatchPendingLoadRequests()
 {
     [[mainFrame webView] _dispatchPendingLoadRequests];
index d93505f..65a31cb 100644 (file)
@@ -563,11 +563,6 @@ unsigned TestRunner::numberOfActiveAnimations() const
     return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame->handle());
 }
 
-void TestRunner::disableImageLoading()
-{
-    m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false);
-}
-
 void TestRunner::dispatchPendingLoadRequests()
 {
     // FIXME: Implement for testing fix for 6727495
index a1c1a48..a1ed415 100644 (file)
@@ -193,7 +193,6 @@ public Q_SLOTS:
     void removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
 
     void dispatchPendingLoadRequests();
-    void disableImageLoading();
 
     void clearAllApplicationCaches();
     void clearApplicationCacheForOrigin(const QString& url);
index 1728465..7516edb 100644 (file)
@@ -137,19 +137,6 @@ JSStringRef TestRunner::copyEncodedHostName(JSStringRef name)
     return 0;
 }
 
-void TestRunner::disableImageLoading()
-{
-    COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(&webView)))
-        return;
-    
-    COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(&preferences)))
-        return;
-    
-    preferences->setLoadsImagesAutomatically(FALSE);
-}
-
 void TestRunner::dispatchPendingLoadRequests()
 {
     // FIXME: Implement for testing fix for 6727495
index 978b87e..f84652b 100644 (file)
@@ -453,11 +453,6 @@ void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef glo
 
 }
 
-void TestRunner::disableImageLoading()
-{
-
-}
-
 void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
 {
     // FIXME: implement