Bug 36033
Summary: | layoutTestController.overridePreference() affects tests after the current test | ||
---|---|---|---|
Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ddkilzer, dimich, eric, glen, gwilson, simon.fraser |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | OS X 10.5 | ||
Bug Depends on: | |||
Bug Blocks: | 35905 |
Simon Fraser (smfr)
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)
I'm not sure what else it should do, but I'm certainly interested in any suggestions you have.
Simon Fraser (smfr)
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
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)
If we made WebPreferences copyable, we could just set prefs on a single WebView without affecting the global preferences.
Alexey Proskuryakov
> 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)
(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.