2011-06-29 Yuta Kitamura <yutak@chromium.org>
authoryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2011 03:40:01 +0000 (03:40 +0000)
committeryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jun 2011 03:40:01 +0000 (03:40 +0000)
        Reviewed by Kent Tamura.

        DRT: Make Hixie76WebSocketProtocolEnabled preference flag configurable from LayoutTestController
        https://bugs.webkit.org/show_bug.cgi?id=63532

        LayoutTestController::overridePreference() will be used to change the value of
        the Hixie76WebSocketProtocolEnabled preference flag from layout tests. In this way,
        we can avoid writing a lot of boilerplate code in each port's DumpRenderTree, but
        at least we need to reset preference values in DumpRenderTree every time we start
        a new test because preference values changed in some test should not be leaked
        to the next test.

        * DumpRenderTree/chromium/LayoutTestController.cpp:
        (LayoutTestController::overridePreference):
        The name of preference key is defined in WebKit/{mac/WebView,win}/WebPreferenceKeysPrivate.h.
        * DumpRenderTree/chromium/WebPreferences.cpp:
        (WebPreferences::reset):
        Set the default value. This will be called from TestShell::resetTestController().
        (WebPreferences::applyTo):
        * DumpRenderTree/chromium/WebPreferences.h:
        * DumpRenderTree/mac/DumpRenderTree.mm:
        (resetDefaultsToConsistentValues): Set the default value.
        * DumpRenderTree/win/DumpRenderTree.cpp:
        (resetDefaultsToConsistentValues): Ditto.

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

Tools/ChangeLog
Tools/DumpRenderTree/chromium/LayoutTestController.cpp
Tools/DumpRenderTree/chromium/WebPreferences.cpp
Tools/DumpRenderTree/chromium/WebPreferences.h
Tools/DumpRenderTree/mac/DumpRenderTree.mm
Tools/DumpRenderTree/win/DumpRenderTree.cpp

index ca972c9..8246b1e 100644 (file)
@@ -1,3 +1,30 @@
+2011-06-29  Yuta Kitamura  <yutak@chromium.org>
+
+        Reviewed by Kent Tamura.
+
+        DRT: Make Hixie76WebSocketProtocolEnabled preference flag configurable from LayoutTestController
+        https://bugs.webkit.org/show_bug.cgi?id=63532
+
+        LayoutTestController::overridePreference() will be used to change the value of
+        the Hixie76WebSocketProtocolEnabled preference flag from layout tests. In this way,
+        we can avoid writing a lot of boilerplate code in each port's DumpRenderTree, but
+        at least we need to reset preference values in DumpRenderTree every time we start
+        a new test because preference values changed in some test should not be leaked
+        to the next test.
+
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::overridePreference):
+        The name of preference key is defined in WebKit/{mac/WebView,win}/WebPreferenceKeysPrivate.h.
+        * DumpRenderTree/chromium/WebPreferences.cpp:
+        (WebPreferences::reset):
+        Set the default value. This will be called from TestShell::resetTestController().
+        (WebPreferences::applyTo):
+        * DumpRenderTree/chromium/WebPreferences.h:
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetDefaultsToConsistentValues): Set the default value.
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetDefaultsToConsistentValues): Ditto.
+
 2011-06-29  Kenichi Ishibashi  <bashi@chromium.org>
 
         Reviewed by Adam Barth.
index b58a944..bf7f3bb 100644 (file)
@@ -1425,6 +1425,8 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments,
         prefs->allowDisplayOfInsecureContent = cppVariantToBool(value);
     else if (key == "WebKitAllowRunningInsecureContent")
         prefs->allowRunningOfInsecureContent = cppVariantToBool(value);
+    else if (key == "WebKitHixie76WebSocketProtocolEnabled")
+        prefs->hixie76WebSocketProtocolEnabled = cppVariantToBool(value);
     else {
         string message("Invalid name for preference: ");
         message.append(key);
index 0680966..0111fa2 100644 (file)
@@ -110,6 +110,7 @@ void WebPreferences::reset()
     legacyAccelerated2dCanvasEnabled = false;
     acceleratedDrawingEnabled = false;
     forceCompositingMode = false;
+    hixie76WebSocketProtocolEnabled = true;
 }
 
 void WebPreferences::applyTo(WebView* webView)
@@ -162,6 +163,7 @@ void WebPreferences::applyTo(WebView* webView)
     settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled);
     settings->setLegacyAccelerated2dCanvasEnabled(legacyAccelerated2dCanvasEnabled);
     settings->setAcceleratedDrawingEnabled(acceleratedDrawingEnabled);
+    settings->setHixie76WebSocketProtocolEnabled(hixie76WebSocketProtocolEnabled);
 
     // Fixed values.
     settings->setShouldPaintCustomScrollbars(true);
index 38fb557..583ee21 100644 (file)
@@ -85,6 +85,7 @@ struct WebPreferences {
     bool accelerated2dCanvasEnabled;
     bool legacyAccelerated2dCanvasEnabled;
     bool acceleratedDrawingEnabled;
+    bool hixie76WebSocketProtocolEnabled;
 
     WebPreferences() { reset(); }
     void reset();
index c40d8b9..2ab2d6a 100644 (file)
@@ -477,6 +477,7 @@ static void resetDefaultsToConsistentValues()
     [preferences setWebGLEnabled:NO];
     [preferences setUsePreHTML5ParserQuirks:NO];
     [preferences setAsynchronousSpellCheckingEnabled:NO];
+    [preferences setHixie76WebSocketProtocolEnabled:YES];
 
     [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
     
index 2db43da..3f9ff7c 100644 (file)
@@ -877,6 +877,7 @@ static void resetDefaultsToConsistentValues(IWebPreferences* preferences)
         prefsPrivate->setFrameFlatteningEnabled(FALSE);
         prefsPrivate->setOfflineWebApplicationCacheEnabled(TRUE);
         prefsPrivate->setLoadsSiteIconsIgnoringImageLoadingPreference(FALSE);
+        prefsPrivate->setHixie76WebSocketProtocolEnabled(TRUE);
     }
     setAlwaysAcceptCookies(false);