WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
Bug 36033
layoutTestController.overridePreference() affects tests after the current test
https://bugs.webkit.org/show_bug.cgi?id=36033
Summary
layoutTestController.overridePreference() affects tests after the current test
Simon Fraser (smfr)
Reported
2010-03-11 14:33:01 PST
layoutTestController.overridePreference() changes the setting in [WebPreferences standardPreferences]. This affects both the current test, and all subsequent tests in the same DRT invocation. This is bad.
Attachments
Add attachment
proposed patch, testcase, etc.
Eric Seidel (no email)
Comment 1
2010-03-11 22:46:57 PST
I'm not sure what else it should do, but I'm certainly interested in any suggestions you have.
Simon Fraser (smfr)
Comment 2
2010-03-12 08:11:50 PST
This is really a problem with how WebPreferences work. You can't currently set a WebPreference without touching +standardPreferences. One option would be to save a list of prefs changed by overridePreference(), and then undo those changes at the end of the test.
Glenn Wilson
Comment 3
2010-03-12 08:39:19 PST
My original version of overridePreference kept a list of modified preferences in WebPreferences to revert to after each test. Others felt that this was too cumbersome. I still agree that this is necessary! This was scrapped in favor of letting DRT just reset relevant preferences itself before each test. See
bug 20534
.
Simon Fraser (smfr)
Comment 4
2010-03-12 09:11:17 PST
If we made WebPreferences copyable, we could just set prefs on a single WebView without affecting the global preferences.
Alexey Proskuryakov
Comment 5
2010-03-12 20:40:09 PST
> This was scrapped in favor of letting DRT just reset relevant preferences > itself before each test.
Everyone CC'ed here probably knows this, but I'll rephrase this to have all relevant information spelled out: the current design is to reset preferences in resetDefaultsToConsistentValues() function in DumpRenderTree.mm.
Simon Fraser (smfr)
Comment 6
2010-03-12 21:04:55 PST
(In reply to
comment #5
)
> Everyone CC'ed here probably knows this, but I'll rephrase this to have all > relevant information spelled out: the current design is to reset preferences in > resetDefaultsToConsistentValues() function in DumpRenderTree.mm.
I saw a number of tests overriding preferences (e.g. caret browsing stuff) without corresponding resets in DRT. It's unfortunate that someone can write a test to change a pref, but then also have to submit a code patch at the same time.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug