Bug 139347 - [Mac] DumpRenderTree sets storage directory incorrectly
Summary: [Mac] DumpRenderTree sets storage directory incorrectly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks: 138958
  Show dependency treegraph
 
Reported: 2014-12-06 13:05 PST by Alexey Proskuryakov
Modified: 2014-12-19 14:28 PST (History)
5 users (show)

See Also:


Attachments
proposed fix (1.33 KB, patch)
2014-12-06 13:11 PST, Alexey Proskuryakov
ap: review-
Details | Formatted Diff | Diff
proposed fix (2.46 KB, patch)
2014-12-06 13:35 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2014-12-06 13:05:24 PST
Storage tests are flaky in WebKit1, because DumpRenderTree effectively makes all parallel processes use the same temporary directory.

I hope that this fix will address increased appcache test flakiness that started this week, when I changed DRT to delete appcache between tests - this made sqlite race for access to ApplicationCache.db a lot more than before.
Comment 1 Alexey Proskuryakov 2014-12-06 13:11:10 PST
Created attachment 242724 [details]
proposed fix
Comment 2 Alexey Proskuryakov 2014-12-06 13:22:11 PST
I'm now trying to remember if we needed to set standard defaults in order to make frameworks that use CFPreferences work...
Comment 3 Alexey Proskuryakov 2014-12-06 13:27:42 PST
Comment on attachment 242724 [details]
proposed fix

Bummer. http://trac.webkit.org/changeset/158652 says:

--------------
Using NSArgumentDomain was not a good idea. While it works with NSUserDefaults
and CFPreferencesCopyAppValue family of functions, it doesn't work with
CFPreferencesCopyValue(..., kCFPreferencesCurrentApplication, ...).
--------------

So, we should use NSArgumentDomain only for per instance preferences.
Comment 4 Alexey Proskuryakov 2014-12-06 13:35:03 PST
Created attachment 242726 [details]
proposed fix

Looking at WebKit1 code, we have a bunch of unfortunate special cases that bypass WebPreferences, and use NSUserDefaults directly.

WebKitKerningAndLigaturesEnabledByDefaultDefaultsKey is read and written by WebView, so it's global per process identifier, and cannot be different in different WebViews or in parallel DumpRenderTrees.

Same thing with these ones, which are further complicated due to interactions between WebKit and AppKit preferences:

    [webView setContinuousSpellCheckingEnabled:YES];
    [webView setAutomaticQuoteSubstitutionEnabled:NO];
    [webView setAutomaticLinkDetectionEnabled:NO];
    [webView setAutomaticDashSubstitutionEnabled:NO];
    [webView setAutomaticTextReplacementEnabled:NO];
    [webView setAutomaticSpellingCorrectionEnabled:YES];
    [webView setGrammarCheckingEnabled:YES];
Comment 5 WebKit Commit Bot 2014-12-06 15:52:03 PST
Comment on attachment 242726 [details]
proposed fix

Clearing flags on attachment: 242726

Committed r176917: <http://trac.webkit.org/changeset/176917>
Comment 6 WebKit Commit Bot 2014-12-06 15:52:06 PST
All reviewed patches have been landed.  Closing bug.