Bug 36033

Summary: layoutTestController.overridePreference() affects tests after the current test
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Tools / TestsAssignee: 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)
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
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.