Re-land the patch for https://bugs.webkit.org/show_bug.cgi?id=20534.
authordimich@chromium.org <dimich@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Aug 2009 17:42:43 +0000 (17:42 +0000)
committerdimich@chromium.org <dimich@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Aug 2009 17:42:43 +0000 (17:42 +0000)
commit23611b6c68330962e24231c258636093c234c823
treed150f863380a3988066b2f691bb6cb43768f44a5
parent4ccaae62f7bdf71c29cd6fa80e3450e9c742f0d4
Re-land the patch for https://bugs.webkit.org/show_bug.cgi?id=20534.
Previously reverted since incorrect merge on landing has caused Layout Tests failures on Windows.

WebKit/mac: Added support for overriding default preferences per-test.
Originally implemented by Glenn Wilson <gwilson@chromium.org>.
Reviewed by Adam Roben.
Added new methods for overriding default WebPreference values
and for resetting preferences to their defaults.
See https://bugs.webkit.org/show_bug.cgi?id=20534

* WebView/WebPreferences.mm:
(-[WebPreferences _setPreferenceForTestWithValue:withKey:]): added.
* WebView/WebPreferencesPrivate.h: same.

WebKit/win: Added support for overriding default preferences per-test.
Originally implemented by Glenn Wilson  <gwilson@chromium.org>.
Reviewed by Adam Roben.
Added support for overriding default preferences per-test.
See https://bugs.webkit.org/show_bug.cgi?id=20534

* Interfaces/IWebPreferencesPrivate.idl: added new method setPreferenceForTest
* WebPreferences.cpp: same.
* WebPreferences.h: same.

WebKitTools: Added support for overriding default preferences per-test.
Originally implemented by Glenn Wilson  <gwilson@chromium.org>.
Reviewed by Adam Roben.
Added support for overriding default preferences per-test.
See https://bugs.webkit.org/show_bug.cgi?id=20534

* DumpRenderTree/LayoutTestController.cpp:
(overridePreferenceCallback): add wiring for layoutTestController.overridePreference.
(LayoutTestController::staticFunctions): same.
* DumpRenderTree/LayoutTestController.h: same.
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
(LayoutTestController::overridePreference): added empty overridePreference method.
* DumpRenderTree/mac/DumpRenderTree.mm: implemented preference override.
(resetDefaultsToConsistentValues): new method, resets preferences to same set of value before every test.
(setDefaultsToConsistentValuesForTesting): new method, sets other details of testing environment, every time  DRT starts.
(resetWebViewToConsistentStateBeforeTesting): move some preference setting from here to new resetDefaultsToConsistentValues().
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
(LayoutTestController::overridePreference):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues): new method, resets preferences to same set of value before every test.
(resetWebViewToConsistentStateBeforeTesting): move some preference setting from here to new resetDefaultsToConsistentValues().
(createWebViewAndOffscreenWindow): same.
(main): same.
* DumpRenderTree/win/LayoutTestControllerWin.cpp:
(LayoutTestController::overridePreference):
* DumpRenderTree/wx/LayoutTestControllerWx.cpp:
(LayoutTestController::overridePreference):

LayoutTests: Added support for overriding default preferences per-test.
Originally implemented by Glenn Wilson  <gwilson@chromium.org>.
Reviewed by Adam Roben.
Added tests to verify that default preferences can be overridden per-test
and that overridden values are reset between each test.
See https://bugs.webkit.org/show_bug.cgi?id=20534

* fast/harness/override-preferences-2-expected.txt: Added.
* fast/harness/override-preferences-2.html: Added. Verifies overridePreverence("WebKitDefaultFontSize", "24").
* fast/harness/override-preferences-expected.txt: Added.
* fast/harness/override-preferences.html: Added. Verifies overridePreference("WebKitJavaScriptEnabled", false).
* fast/harness/override-zzz-reset-expected.txt: Added.
* fast/harness/override-zzz-reset.html: Added. Because of 'zzz' this test will run after the tests above and
verify that override of preferences does not 'spill' to the subsequent tests in a batch.
* platform/gtk/Skipped: Tests above disabled for GTK until GTK DRT implements preference override.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@47039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/harness/override-preferences-2-expected.txt [new file with mode: 0644]
LayoutTests/fast/harness/override-preferences-2.html [new file with mode: 0644]
LayoutTests/fast/harness/override-preferences-expected.txt [new file with mode: 0644]
LayoutTests/fast/harness/override-preferences.html [new file with mode: 0644]
LayoutTests/fast/harness/override-zzz-reset-expected.txt [new file with mode: 0644]
LayoutTests/fast/harness/override-zzz-reset.html [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/qt/Skipped
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebPreferences.mm
WebKit/mac/WebView/WebPreferencesPrivate.h
WebKit/win/ChangeLog
WebKit/win/Interfaces/IWebPreferencesPrivate.idl
WebKit/win/WebPreferences.cpp
WebKit/win/WebPreferences.h
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/LayoutTestController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.h
WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp