2008-12-11 Cameron Zwarich <zwarich@apple.com>
authorcwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2008 07:28:27 +0000 (07:28 +0000)
committercwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2008 07:28:27 +0000 (07:28 +0000)
        Rubber-stamped by Mark Rowe.

        Roll out r39212 due to assertion failures during layout tests, multiple
        layout test failures, memory leaks, and obvious incorrectness.

        WebKit/mac:

        * WebView/WebPreferenceKeysPrivate.h:
        * WebView/WebPreferences.mm:
        (-[WebPreferences fullDocumentTeardownEnabled]):
        * WebView/WebPreferencesPrivate.h:

        WebKit/win:

        * Interfaces/IWebPreferencesPrivate.idl:
        * WebPreferenceKeysPrivate.h:
        * WebPreferences.cpp:
        * WebPreferences.h:

        WebKitTools:

        * DumpRenderTree/LayoutTestController.cpp:
        (LayoutTestController::staticFunctions):
        * DumpRenderTree/LayoutTestController.h:
        * DumpRenderTree/mac/DumpRenderTree.mm:
        (resetWebViewToConsistentStateBeforeTesting):
        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
        * DumpRenderTree/win/DumpRenderTree.cpp:
        (resetWebViewToConsistentStateBeforeTesting):
        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
        (LayoutTestController::pauseTransitionAtTimeOnElementWithId):

        LayoutTests:

        * security/override-preferences-2-expected.txt: Removed.
        * security/override-preferences-2.html: Removed.
        * security/override-preferences-expected.txt: Removed.
        * security/override-preferences.html: Removed.
        * security/override-zzz-reset-expected.txt: Removed.
        * security/override-zzz-reset.html: Removed.

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

23 files changed:
LayoutTests/ChangeLog
LayoutTests/security/override-preferences-2-expected.txt [deleted file]
LayoutTests/security/override-preferences-2.html [deleted file]
LayoutTests/security/override-preferences-expected.txt [deleted file]
LayoutTests/security/override-preferences.html [deleted file]
LayoutTests/security/override-zzz-reset-expected.txt [deleted file]
LayoutTests/security/override-zzz-reset.html [deleted file]
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebPreferenceKeysPrivate.h
WebKit/mac/WebView/WebPreferences.mm
WebKit/mac/WebView/WebPreferencesPrivate.h
WebKit/win/ChangeLog
WebKit/win/Interfaces/IWebPreferencesPrivate.idl
WebKit/win/WebPreferenceKeysPrivate.h
WebKit/win/WebPreferences.cpp
WebKit/win/WebPreferences.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/LayoutTestController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.h
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp

index 7b32655..fa331e8 100644 (file)
@@ -1,3 +1,17 @@
+2008-12-11  Cameron Zwarich  <zwarich@apple.com>
+
+        Rubber-stamped by Mark Rowe.
+
+        Roll out r39212 due to assertion failures during layout tests, multiple
+        layout test failures, memory leaks, and obvious incorrectness.
+
+        * security/override-preferences-2-expected.txt: Removed.
+        * security/override-preferences-2.html: Removed.
+        * security/override-preferences-expected.txt: Removed.
+        * security/override-preferences.html: Removed.
+        * security/override-zzz-reset-expected.txt: Removed.
+        * security/override-zzz-reset.html: Removed.
+
 2008-12-11  Nikolas Zimmermann  <nikolas.zimmermann@torchmobile.com>
 
         Reviewed by Holger Freyther.
diff --git a/LayoutTests/security/override-preferences-2-expected.txt b/LayoutTests/security/override-preferences-2-expected.txt
deleted file mode 100644 (file)
index abcceaa..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-This test verifies that layoutTestController can have its default preferences overriden. This test verifies that the API will accept string values and also override the default font size. You should see "PASS" below.
-
-PASS
diff --git a/LayoutTests/security/override-preferences-2.html b/LayoutTests/security/override-preferences-2.html
deleted file mode 100644 (file)
index 23056f4..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
-<script>
-    if(window.layoutTestController) {
-        layoutTestController.dumpAsText();
-        layoutTestController.overridePreference("WebKitDefaultFontSize", "24");
-    }
-</script>
-<body>
-    <p>This test verifies that layoutTestController can have its default preferences overriden.  
-    This test verifies that the API will accept string values and also override the default font size.  
-    You should see "PASS" below.</p>
-    <script>
-        var p = document.getElementsByTagName("p")[0];
-        if(!window.layoutTestController || window.getComputedStyle(p).fontSize == "24px")
-            document.write("PASS");
-    </script>
-</body>
-</html>
diff --git a/LayoutTests/security/override-preferences-expected.txt b/LayoutTests/security/override-preferences-expected.txt
deleted file mode 100644 (file)
index 4c348e0..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-This is a test that verifies that layoutTestController can have its default preferences overridden. This test specifically checks that Javascript can be disabled, and you should see "PASS" below if viewing with a browser.
-
-PASS
diff --git a/LayoutTests/security/override-preferences.html b/LayoutTests/security/override-preferences.html
deleted file mode 100644 (file)
index 740a739..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<html> 
-<body> 
-<script> 
-    if(window.layoutTestController) {
-        layoutTestController.dumpAsText()
-        layoutTestController.overridePreference("WebKitJavaScriptEnabled", false);
-    }
-    
-    function loadstatus() {
-        if(window.layoutTestController)
-            document.getElementById("status").innerHTML="FAIL";
-    }
-</script> 
-<body onload="loadstatus()">
-    <p>This is a test that verifies that layoutTestController can have its default preferences overridden.  This test specifically checks that Javascript can be disabled, and you should see "PASS" below if viewing with a browser.</p>
-    <span id="status">PASS</span>
-</body>
-</html>
diff --git a/LayoutTests/security/override-zzz-reset-expected.txt b/LayoutTests/security/override-zzz-reset-expected.txt
deleted file mode 100644 (file)
index dee292e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-This test verifies that the layoutTestController will reset its default preferences after every layout test. You should see "PASS" below.
-
-PASS
diff --git a/LayoutTests/security/override-zzz-reset.html b/LayoutTests/security/override-zzz-reset.html
deleted file mode 100644 (file)
index cbeb1e0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<html> 
-<body> 
-<script> 
-    if(window.layoutTestController)
-        layoutTestController.dumpAsText();
-</script> 
-<body>
-    <p>This test verifies that the layoutTestController will reset its default preferences after every layout test.  You should see "PASS" below.</p>
-    <span id="status">FAIL</span>
-    <script>
-        document.getElementById("status").innerHTML="PASS";        
-    </script>
-</body>
-</html>
index f346f04..c781aec 100644 (file)
@@ -1,3 +1,15 @@
+2008-12-11  Cameron Zwarich  <zwarich@apple.com>
+
+        Rubber-stamped by Mark Rowe.
+
+        Roll out r39212 due to assertion failures during layout tests, multiple
+        layout test failures, memory leaks, and obvious incorrectness.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences fullDocumentTeardownEnabled]):
+        * WebView/WebPreferencesPrivate.h:
+
 2008-12-11  Stephanie Lewis  <slewis@apple.com>
 
         Fix build.
index d009e44..98daec0 100644 (file)
@@ -72,7 +72,6 @@
 #define WebKitEnableFullDocumentTeardownPreferenceKey @"WebKitEnableFullDocumentTeardown"
 #define WebKitOfflineWebApplicationCacheEnabledPreferenceKey @"WebKitOfflineWebApplicationCacheEnabled"
 #define WebKitZoomsTextOnlyPreferenceKey @"WebKitZoomsTextOnly"
-#define WebKitDefaultPreferencesOverridden @"WebKitDefaultPreferencesOverridden"
 
 // These are private both because callers should be using the cover methods and because the
 // cover methods themselves are private.
index 1d604f5..e595861 100644 (file)
@@ -1095,25 +1095,6 @@ static NSString *classIBCreatorID = nil;
 {
     return [self _boolValueForKey:WebKitEnableFullDocumentTeardownPreferenceKey];
 }
-
-- (void)resetToDefaults
-{
-    if (![self _boolValueForKey:WebKitDefaultPreferencesOverridden])
-        return;
-    [self init];
-
-    [self _setBoolValue:false forKey:WebKitDefaultPreferencesOverridden];
-    [self _postPreferencesChangesNotification];
-}
-
-- (void)overridePreference:(NSString *)key flag:(NSString *)preferenceFlag
-{
-    [self _setStringValue:preferenceFlag forKey:key];
-    [self _setBoolValue:true forKey:WebKitDefaultPreferencesOverridden];
-}
-
-
-
 @end
 
 @implementation WebPreferences (WebInternal)
index 624683e..99ff49c 100644 (file)
@@ -102,15 +102,6 @@ extern NSString *WebPreferencesRemovedNotification;
 - (WebTextDirectionSubmenuInclusionBehavior)textDirectionSubmenuInclusionBehavior;
 - (void)setTextDirectionSubmenuInclusionBehavior:(WebTextDirectionSubmenuInclusionBehavior)behavior;
 
-// This method is meant for overriding preferences for tests run
-// with DumpRenderTree only.
--(void)overridePreference:(NSString *)key flag:(NSString *)flag;
-
-// This method is meant for resetting overridden preferences for tests run
-// with DumpRenderTree only.
--(void)resetToDefaults;
-
-
 // If site-specific spoofing is enabled, some pages that do inappropriate user-agent string checks will be
 // passed a nonstandard user-agent string to get them to work correctly. This method might be removed in
 // the future when there's no more need for it.
index 861ec1d..85ca272 100644 (file)
@@ -1,3 +1,15 @@
+2008-12-11  Cameron Zwarich  <zwarich@apple.com>
+
+        Rubber-stamped by Mark Rowe.
+
+        Roll out r39212 due to assertion failures during layout tests, multiple
+        layout test failures, memory leaks, and obvious incorrectness.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        * WebPreferences.h:
+
 2008-12-10  Glenn Wilson  <gwilson@google.com>
 
         Reviewed by Adam Roben.
index 76397e4..62ed0be 100644 (file)
@@ -66,13 +66,4 @@ interface IWebPreferencesPrivate : IUnknown
 
     HRESULT setLocalStorageEnabled([in] BOOL enabled);
     HRESULT localStorageEnabled([out, retval] BOOL *enabled);
-
-    // This method is meant for overriding preferences for tests run
-    // with DumpRenderTree only.
-    HRESULT overridePreference([in] BSTR key, [in] BSTR value);
-
-    // This method is meant for resetting overridden preferences for tests run
-    // with DumpRenderTree only.
-    HRESULT resetToDefaults();
-
 }
index b2e1296..b74fc04 100644 (file)
@@ -62,7 +62,6 @@
 #define WebKitUsesPageCachePreferenceKey "WebKitUsesPageCachePreferenceKey"
 #define WebKitCacheModelPreferenceKey "WebKitCacheModelPreferenceKey"
 #define WebKitLocalStorageDatabasePathPreferenceKey "WebKitLocalStorageDatabasePath"
-#define WebKitDefaultPreferencesOverridden "WebKitDefaultPreferencesOverridden"
 
 // These are private both because callers should be using the cover methods and because the
 // cover methods themselves are private.
index 3f35c4c..5ad5cb1 100644 (file)
@@ -1223,39 +1223,6 @@ HRESULT WebPreferences::zoomsTextOnly(BOOL* zoomsTextOnly)
     return S_OK;
 }
 
-HRESULT STDMETHODCALLTYPE WebPreferences::overridePreference(BSTR key, BSTR value)
-{
-    if (!SysStringLen(key) || !SysStringLen(value))
-        return E_FAIL;
-    RetainPtr<CFStringRef> keyRef(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<UniChar*>(key), SysStringLen(key)));
-    setStringValue(keyRef.get(), value);
-    setBoolValue(CFSTR(WebKitDefaultPreferencesOverridden), true);
-    return S_OK;
-}
-
-HRESULT STDMETHODCALLTYPE WebPreferences::resetToDefaults()
-{
-    if (!boolValueForKey(CFSTR(WebKitDefaultPreferencesOverridden)))
-        return S_OK;
-
-    int count = CFDictionaryGetCount(defaultSettings);
-    if (count <= 0)
-        return S_OK;
-
-    OwnArrayPtr<CFTypeRef> keys(new CFTypeRef[count]);
-    OwnArrayPtr<CFTypeRef> values(new CFTypeRef[count]);
-    CFDictionaryGetKeysAndValues(defaultSettings, keys.get(), values.get());
-
-    for (int i = 0; i < count; ++i)
-        setValueForKey(static_cast<CFStringRef>(keys[i]), values[i]);
-
-    setBoolValue(CFSTR(WebKitDefaultPreferencesOverridden), false);
-
-    postPreferencesChangesNotification();
-
-    return S_OK;
-}
-
 void WebPreferences::willAddToWebView()
 {
     ++m_numWebViews;
index dd5f60e..1dbcd31 100644 (file)
@@ -338,16 +338,6 @@ public:
     virtual HRESULT STDMETHODCALLTYPE zoomsTextOnly( 
     /* [retval][out] */ BOOL *zoomsTextOnly);
 
-    // This method is meant for overriding preferences for tests run
-    // with DumpRenderTree only.
-    virtual HRESULT STDMETHODCALLTYPE overridePreference(
-        /* [in] */ BSTR key,
-        /* [in] */ BSTR value);
-
-    // This method is meant for resetting overridden preferences for tests run
-    // with DumpRenderTree only.
-    virtual HRESULT STDMETHODCALLTYPE resetToDefaults();
-
     // WebPreferences
 
     // This method accesses a different preference key than developerExtrasEnabled.
index 9b99b71..988de3f 100644 (file)
@@ -1,3 +1,21 @@
+2008-12-11  Cameron Zwarich  <zwarich@apple.com>
+
+        Rubber-stamped by Mark Rowe.
+
+        Roll out r39212 due to assertion failures during layout tests, multiple
+        layout test failures, memory leaks, and obvious incorrectness.
+
+        * DumpRenderTree/LayoutTestController.cpp:
+        (LayoutTestController::staticFunctions):
+        * DumpRenderTree/LayoutTestController.h:
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebViewToConsistentStateBeforeTesting):
+        * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetWebViewToConsistentStateBeforeTesting):
+        * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+        (LayoutTestController::pauseTransitionAtTimeOnElementWithId):
+
 2008-12-10  Glenn Wilson  <gwilson@google.com>
 
         Reviewed by Adam Roben.
index bf819f2..cd55130 100644 (file)
@@ -348,22 +348,6 @@ static JSValueRef isCommandEnabledCallback(JSContextRef context, JSObjectRef fun
     return JSValueMakeBoolean(context, controller->isCommandEnabled(name.get()));
 }
 
-static JSValueRef overridePreferenceCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
-{
-    if (argumentCount < 2)
-        return JSValueMakeUndefined(context);
-
-    JSRetainPtr<JSStringRef> key(Adopt, JSValueToStringCopy(context, arguments[0], exception));
-    ASSERT(!*exception);
-    JSRetainPtr<JSStringRef> value(Adopt, JSValueToStringCopy(context, arguments[1], exception));
-    ASSERT(!*exception);
-
-    LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
-    controller->overridePreference(key.get(), value.get());
-
-    return JSValueMakeUndefined(context);
-}
-
 static JSValueRef keepWebHistoryCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     // Has mac implementation
@@ -818,7 +802,6 @@ JSStaticFunction* LayoutTestController::staticFunctions()
         { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
-        { "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "pathToLocalResource", pathToLocalResourceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "queueBackNavigation", queueBackNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "queueForwardNavigation", queueForwardNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
index c37736a..0d0fd5a 100644 (file)
@@ -73,7 +73,6 @@ public:
     void setUserStyleSheetLocation(JSStringRef path);
     void setPersistentUserStyleSheetLocation(JSStringRef path);
     void clearPersistentUserStyleSheet();
-    void overridePreference(JSStringRef key, JSStringRef flag);
     int windowCount();
     
     bool elementDoesAutoCompleteForElementWithId(JSStringRef id);
index c67b46c..afb2b0d 100644 (file)
@@ -978,7 +978,6 @@ static void resetWebViewToConsistentStateBeforeTesting()
     [webView _clearMainFrameName];
 
     WebPreferences *preferences = [webView preferences];
-    [preferences resetToDefaults];
     [preferences setPrivateBrowsingEnabled:NO];
     [preferences setAuthorAndUserStylesEnabled:YES];
     [preferences setJavaScriptCanOpenWindowsAutomatically:YES];
index 965a4ad..c475cdc 100644 (file)
@@ -267,17 +267,6 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
     [[WebPreferences standardPreferences] setUserStyleSheetLocation:url];
 }
 
-void LayoutTestController::overridePreference(JSStringRef key, JSStringRef flag)
-{
-    RetainPtr<CFStringRef> keyCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, key));
-    NSString *keyNS = (NSString *)keyCF.get();
-
-    RetainPtr<CFStringRef> flagCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, flag));
-    NSString *flagNS = (NSString *)flagCF.get();
-
-    [[WebPreferences standardPreferences] overridePreference:keyNS flag:flagNS];
-}
-
 void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
 {
     RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL));
index 605783d..c844991 100644 (file)
@@ -656,7 +656,6 @@ static void resetWebViewToConsistentStateBeforeTesting()
 
         COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
         if (prefsPrivate) {
-            prefsPrivate->resetToDefaults();
             prefsPrivate->setAuthorAndUserStylesEnabled(TRUE);
             prefsPrivate->setDeveloperExtrasEnabled(FALSE);
         }
index 98af68e..45d4a2d 100644 (file)
@@ -41,7 +41,6 @@
 #include <JavaScriptCore/Assertions.h>
 #include <JavaScriptCore/JavaScriptCore.h>
 #include <JavaScriptCore/JSRetainPtr.h>
-#include <JavaScriptCore/JSStringRefBSTR.h>
 #include <WebKit/WebKit.h>
 #include <string>
 #include <CoreFoundation/CoreFoundation.h>
@@ -659,24 +658,3 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop
 {
     return false; // FIXME: Implement this on Windows
 }
-
-void LayoutTestController::overridePreference(JSStringRef key, JSStringRef flag)
-{
-    COMPtr<IWebView> webView;
-    if (FAILED(frame->webView(&webView)))
-        return;
-
-    COMPtr<IWebPreferences> preferences;
-    if (FAILED(webView->preferences(&preferences)))
-        return;
-
-    COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
-    if (!prefsPrivate)
-        return;
-
-    BSTR keyBSTR = JSStringCopyBSTR(key);
-    BSTR flagBSTR = JSStringCopyBSTR(flag);
-    prefsPrivate->overridePreference(keyBSTR, flagBSTR);
-    SysFreeString(keyBSTR);
-    SysFreeString(flagBSTR);
-}