Title: [274111] trunk
Revision
274111
Author
wei...@apple.com
Date
2021-03-08 14:47:21 -0800 (Mon, 08 Mar 2021)

Log Message

Add preference reseting to WebKitLegacy Windows to simplify testing reset
https://bugs.webkit.org/show_bug.cgi?id=222865

Reviewed by Brent Fulgham.

Source/WebKitLegacy/win:

Add resetForTesting() function to allow easy reseting of all preferences
for testing, matching functionality added to Cocoa WebKitLegacy.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferences.cpp:
(WebPreferences::resetForTesting):
* WebPreferences.h:

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):
Call the new resetForTesting() method to ensure all values are reset back
to defaults for each test without have to explicitly list them.

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (274110 => 274111)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2021-03-08 22:41:57 UTC (rev 274110)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2021-03-08 22:47:21 UTC (rev 274111)
@@ -1,3 +1,18 @@
+2021-03-08  Sam Weinig  <wei...@apple.com>
+
+        Add preference reseting to WebKitLegacy Windows to simplify testing reset
+        https://bugs.webkit.org/show_bug.cgi?id=222865
+
+        Reviewed by Brent Fulgham.
+
+        Add resetForTesting() function to allow easy reseting of all preferences
+        for testing, matching functionality added to Cocoa WebKitLegacy.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferences.cpp:
+        (WebPreferences::resetForTesting):
+        * WebPreferences.h:
+
 2021-03-08  Stephan Szabo  <stephan.sz...@sony.com>
 
         [WinCairo] Builds with ENABLE_CONTEXT_MENUS=OFF fail

Modified: trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl (274110 => 274111)


--- trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl	2021-03-08 22:41:57 UTC (rev 274110)
+++ trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl	2021-03-08 22:47:21 UTC (rev 274111)
@@ -277,4 +277,8 @@
     HRESULT setSpeechRecognitionEnabled([in] BOOL enabled);
     HRESULT overscrollBehaviorEnabled([ out, retval ] BOOL*);
     HRESULT setOverscrollBehaviorEnabled([in] BOOL enabled);
+    HRESULT resetForTesting();
 }
+
+// NOTE: Please do not add any more preferences that are only for testing purposes. Instead,
+// please use the generalized set<type>PreferenceForTesting() functions.

Modified: trunk/Source/WebKitLegacy/win/WebPreferences.cpp (274110 => 274111)


--- trunk/Source/WebKitLegacy/win/WebPreferences.cpp	2021-03-08 22:41:57 UTC (rev 274110)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.cpp	2021-03-08 22:47:21 UTC (rev 274111)
@@ -2611,3 +2611,9 @@
     setBoolValue(WebKitOverscrollBehaviorEnabledPreferenceKey, enabled);
     return S_OK;
 }
+
+HRESULT WebPreferences::resetForTesting()
+{
+    load();
+    return S_OK;
+}

Modified: trunk/Source/WebKitLegacy/win/WebPreferences.h (274110 => 274111)


--- trunk/Source/WebKitLegacy/win/WebPreferences.h	2021-03-08 22:41:57 UTC (rev 274110)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.h	2021-03-08 22:47:21 UTC (rev 274111)
@@ -315,6 +315,7 @@
     virtual HRESULT STDMETHODCALLTYPE setSpeechRecognitionEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE overscrollBehaviorEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setOverscrollBehaviorEnabled(BOOL);
+    virtual HRESULT STDMETHODCALLTYPE resetForTesting();
 
     // WebPreferences
 

Modified: trunk/Tools/ChangeLog (274110 => 274111)


--- trunk/Tools/ChangeLog	2021-03-08 22:41:57 UTC (rev 274110)
+++ trunk/Tools/ChangeLog	2021-03-08 22:47:21 UTC (rev 274111)
@@ -1,3 +1,15 @@
+2021-03-08  Sam Weinig  <wei...@apple.com>
+
+        Add preference reseting to WebKitLegacy Windows to simplify testing reset
+        https://bugs.webkit.org/show_bug.cgi?id=222865
+
+        Reviewed by Brent Fulgham.
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (resetWebPreferencesToConsistentValues):
+        Call the new resetForTesting() method to ensure all values are reset back
+        to defaults for each test without have to explicitly list them.
+
 2021-03-08  Aakash Jain  <aakash_j...@apple.com>
 
         [ews] Remove old Python 2 related code

Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (274110 => 274111)


--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2021-03-08 22:41:57 UTC (rev 274110)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2021-03-08 22:47:21 UTC (rev 274111)
@@ -837,12 +837,15 @@
 {
     ASSERT(preferences);
 
-    enableExperimentalFeatures(preferences);
-
     preferences->setAutosaves(FALSE);
 
     COMPtr<IWebPreferencesPrivate8> prefsPrivate(Query, preferences);
     ASSERT(prefsPrivate);
+
+    prefsPrivate->resetForTesting();
+
+    enableExperimentalFeatures(preferences);
+
     prefsPrivate->setFullScreenEnabled(TRUE);
 
 #ifdef USE_MAC_FONTS
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to