[webkit-reviews] review requested: [Bug 20534] DumpRenderTree needs a way to override settings on a per-test basis : [Attachment 23056] Possible patch to issue 20534

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 28 09:26:29 PDT 2008

Glenn Wilson <wilsong at gmail.com> has asked  for review:
Bug 20534: DumpRenderTree needs a way to override settings on a per-test basis

Attachment 23056: Possible patch to issue 20534

------- Additional Comments from Glenn Wilson <wilsong at gmail.com>
Here is a possible patch to this issue.  There are some questions that still
remain, however.

This patch allows a layout test to override a default WebPreference value at
test time.  For instance:

layoutTestController.overridePreference("WebKitJavaScriptEnabled", false);

will turn javascript off for the rest of the test.

Several decisions/observations I made:

1.  To keep things simple, I only developed this patch to set or unset boolean
It would be possible to add other methods that set string or integer values,
but it would either require IWebPreferences.idl to handle classes it probably
shouldn't (CFPropertyListRef), or multiple methods in LayoutTestController to
accept multiple input data types.  Both of those options seemed less than
appealing to me, but I'm hoping for feedback about what to do there.

2.  Overriding the flag seems to only work once per layout test -- that is, you
cannot disable javascript, try to do some javascript work, then re-enable
javascript.  I'm thinking that this is an effect of layoutTestController, and
not the new overridePreference method.

3.  The key values used in the call (i.e. "WebKitJavaScriptEnabled") are drawn
directly from WebPreferences.  So if there is a key in the dictionary with a
boolean value set for it, then it can be set.  I added multiple erroneous calls
in the layout test to illustrate that passing bad input to overridePreference
would not crash the test.

What else should be done here?

More information about the webkit-reviews mailing list