[webkit-dev] Settings and Preferences in layout tests

Brady Eidson beidson at apple.com
Wed Sep 26 16:28:07 PDT 2012


On Sep 26, 2012, at 4:15 PM, Simon Fraser <simon.fraser at apple.com> wrote:

> On Sep 26, 2012, at 4:13 PM, Brady Eidson <beidson at apple.com> wrote:
> 
>> This works for any preference;  Even a new one that has never been twiddled in a regression test before.
>> 
>> For example in http://trac.webkit.org/changeset/127956 we added a new test that twiddled the "WebKitStorageBlockingPolicy" preference and we didn't need to change any DRT Mac code to accomplish this.
>> 
>> Compared to adding a single implementation to internal.settings, this was *NO* additional work.
> 
> But is there code to undo this pref change for subsequent tests?

I looked into the mechanism that does this.

On Sep 26, 2012, at 1:44 PM, Simon Fraser <simon.fraser at apple.com> wrote:

> I looked at testRunner.overridePreference(), and it doesn't appear to reset the value at the end of the test.

That happens elsewhere, in:
static void resetDefaultsToConsistentValues()

Indeed, each individual pref is currently managed with unique API calls here, and the example I provided of WebKitStorageBlockingPolicy leaks.

However, the key/value based preference mechanism can easily be augmented within DRT in a general way that will fix this and all future key/value preference usage.  That change would only have to happen once per port (assuming the port supports key/value based prefs)

 Brady

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120926/3979a297/attachment.html>


More information about the webkit-dev mailing list