Bug 69204 - WTR is not successfully changing the NSUserDefaults
Summary: WTR is not successfully changing the NSUserDefaults
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
Depends on:
Reported: 2011-09-30 18:45 PDT by Sam Weinig
Modified: 2011-10-01 13:47 PDT (History)
2 users (show)

See Also:

Patch (5.94 KB, patch)
2011-09-30 18:47 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (1.39 KB, patch)
2011-10-01 13:45 PDT, Sam Weinig
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2011-09-30 18:45:20 PDT
WTR should use swizzling to set user defaults, since it doesn't want to set them for all WebProcesses
Comment 1 Sam Weinig 2011-09-30 18:47:14 PDT
Created attachment 109391 [details]
Comment 2 mitz 2011-09-30 19:24:05 PDT
I don’t understand what problem this is solving. Can you explain?
Comment 3 Sam Weinig 2011-09-30 20:33:07 PDT
It seems that just registering the defaults is not enough, as the tests are still running with overlay scrollbars.  Setting the default explicitly would change it for all WebProcesses, so this seemed like the best way to work around the issue.
Comment 4 mitz 2011-09-30 20:53:07 PDT
Registering the default only makes a difference if it is not explicitly set in any other domain.

I believe the proper way to do this is to set the defaults in an appropriately-identified persistent domain (using -setPersistentDomain:forName:) and then add that domain to the search order (using -addSuiteNamed). It would be nicer to do this without persistence, but I am not sure if that’s possible, and WebKit1 DumpRenderTree doesn’t do so either.
Comment 5 mitz 2011-09-30 21:01:52 PDT
I see now. Rather than creating a new volatile domain, you set the NSArgumentDomain, which is one of the volatile domains in the default search list (in fact, right at the top).
Comment 6 mitz 2011-09-30 21:02:45 PDT
Comment on attachment 109391 [details]

Please use -setVolatileDomain:forName:NSArgumentDomain instead.
Comment 7 Sam Weinig 2011-10-01 13:21:46 PDT
(In reply to comment #6)
> (From update of attachment 109391 [details])
> Please use -setVolatileDomain:forName:NSArgumentDomain instead.

Will do.  Thanks for looking into an alternate way to do this.
Comment 8 Sam Weinig 2011-10-01 13:45:11 PDT
Created attachment 109407 [details]
Comment 9 mitz 2011-10-01 13:47:01 PDT
Comment on attachment 109407 [details]

This trumps over any arguments actually passed on the command line, but I suppose that’s ok because the UI process composes the command line.
Comment 10 Sam Weinig 2011-10-01 13:47:54 PDT
Committed r96460: <http://trac.webkit.org/changeset/96460>