Bug 29751 - DumpRenderTree should reset its preferences file on launch
Summary: DumpRenderTree should reset its preferences file on launch
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac All
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
: 31129 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-25 15:13 PDT by Eric Seidel (no email)
Modified: 2013-11-04 23:04 PST (History)
6 users (show)

See Also:


Attachments
proposed fix (1.92 KB, patch)
2013-10-30 00:01 PDT, Alexey Proskuryakov
rniwa: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2 (581.18 KB, application/zip)
2013-10-30 02:23 PDT, Build Bot
no flags Details
patch for landing (1.52 KB, patch)
2013-10-30 12:42 PDT, Alexey Proskuryakov
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion (1.23 MB, application/zip)
2013-10-30 16:35 PDT, Build Bot
no flags Details
how about this? (8.05 KB, patch)
2013-11-04 00:10 PST, Alexey Proskuryakov
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2009-09-25 15:13:12 PDT
DumpRenderTree should reset its preferences file on launch

DRT has a function resetDefaultsToConsistentValues() which is supposed to set the defaults to exactly how we want them for testing.

If you happen to have a default set from a previous run of DRT which you no longer want set it will not remove that default.  It should.

This is what was causing the commit-bot failures landing bug 29612.  My fix for bug 28624 which disables Hardware compositing was sticking in DRT's preferences and not getting reset, even though that change has not landed yet.  I had expected that DRT started from a clean slate of preferences every time, but it does not.
Comment 1 Eric Seidel (no email) 2009-09-25 15:16:55 PDT
Basically we want to do:
"defaults delete DumpRenderTree"
(DumpRenderTree is the "domain" name for DRT's preferences.)
I just don't know how to do that in code via NSUserDefaults.
Comment 2 Alexey Proskuryakov 2013-10-30 00:01:48 PDT
Created attachment 215476 [details]
proposed fix
Comment 3 Ryosuke Niwa 2013-10-30 00:03:39 PDT
Comment on attachment 215476 [details]
proposed fix

View in context: https://bugs.webkit.org/attachment.cgi?id=215476&action=review

> Tools/DumpRenderTree/mac/DumpRenderTree.mm:680
> +    [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:@"DumpRenderTree"];
> +

Does this work if we ran DumpRenderTree concurrently as done in NRWT?
Comment 4 Alexey Proskuryakov 2013-10-30 00:07:43 PDT
It should be fine - running instances have settings in memory, and won't be affected by them being deleted from persistent storage.
Comment 5 Ryosuke Niwa 2013-10-30 00:08:16 PDT
Comment on attachment 215476 [details]
proposed fix

Okay!
Comment 6 Alexey Proskuryakov 2013-10-30 01:24:27 PDT
This test fails WK1 EWS likely because of AppleFontSmoothing issues similar to what we recently saw because of PDFKit.

Perhaps it needs to be set before NSApplication is instantiated, or somehow reset after being changed.

We might be seeing the same on some Mavericks bots that didn't have this preference synchronized to DumpRenderTree persistent defaults before I changed DumpRenderTree to use argument domain today.
Comment 7 Build Bot 2013-10-30 02:23:06 PDT
Comment on attachment 215476 [details]
proposed fix

Attachment 215476 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/17658148

New failing tests:
fast/events/scrollbar-double-click.html
Comment 8 Build Bot 2013-10-30 02:23:08 PDT
Created attachment 215485 [details]
Archive of layout-test-results from webkit-ews-14 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-14  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.5
Comment 9 Alexey Proskuryakov 2013-10-30 12:42:18 PDT
Created attachment 215551 [details]
patch for landing

AppleFontSmoothing got fixed in <http://trac.webkit.org/changeset/158290>. Let's run EWS again.

I also removed WebKit2 parts, let's do that separately in bug 115115.
Comment 10 Alexey Proskuryakov 2013-10-30 12:48:03 PDT
*** Bug 31129 has been marked as a duplicate of this bug. ***
Comment 11 Build Bot 2013-10-30 16:35:48 PDT
Comment on attachment 215551 [details]
patch for landing

Attachment 215551 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/17758019

New failing tests:
css2.1/20110323/text-indent-014.htm
css2.1/20110323/overflow-applies-to-007.htm
fast/block/float/floats-wrap-inside-inline-007.html
fast/inline/layout-after-inserting-nested-br.html
css2.1/20110323/border-conflict-element-001d.htm
fast/block/float/floats-wrap-inside-inline-003.htm
fast/block/float/max-width-clear-float-with-overflow-hidden.html
csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-002.html
canvas/philip/tests/2d.text.draw.baseline.ideographic.html
css2.1/20110323/overflow-applies-to-013.htm
fast/multicol/newmulticol/float-paginate-complex.html
csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-001.html
css2.1/20110323/overflow-applies-to-014.htm
fast/css/text-indent-first-line-006.html
csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-clipped-004.html
css2.1/20110323/overflow-applies-to-015.htm
fast/css/text-indent-first-line-005.html
fast/css/text-indent-first-line-004.html
csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-002.html
fast/multicol/newmulticol/direct-child-column-span-all.html
fast/multicol/newmulticol/columns-shorthand-parsing.html
fast/css/text-indent-first-line-003.html
fast/css/text-indent-first-line-001.html
fast/css/text-indent-first-line-002.html
fast/multicol/newmulticol/column-rules-fixed-height.html
csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-004.html
css2.1/20110323/overflow-applies-to-012.htm
css2.1/20110323/overflow-applies-to-010.htm
csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-003.html
css2.1/20110323/c541-word-sp-001.htm
Comment 12 Build Bot 2013-10-30 16:35:51 PDT
Created attachment 215571 [details]
Archive of layout-test-results from webkit-ews-01 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-01  Port: mac-mountainlion  Platform: Mac OS X 10.8.5
Comment 13 Alexey Proskuryakov 2013-11-04 00:10:18 PST
Created attachment 215892 [details]
how about this?

I was misunderstanding the inner workings quite a bit... Hopefully, this will work better.
Comment 14 mitz 2013-11-04 07:16:54 PST
Comment on attachment 215892 [details]
how about this?

View in context: https://bugs.webkit.org/attachment.cgi?id=215892&action=review

> Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:66
> +    [[NSUserDefaults standardUserDefaults] setValuesForKeysWithDictionary:dict];

Which domain does this write the defaults (persistently) into? WebKitTestRunner’s or the web content service’s?
Comment 15 Alexey Proskuryakov 2013-11-04 09:02:58 PST
Hmm. Looks like it's ~/Library/Preferences/com.apple.WebKit.WebContent{.Development}.

I'll take out the InjectedBundle change if everything else is OK.
Comment 16 mitz 2013-11-04 20:43:45 PST
(In reply to comment #15)
> Hmm. Looks like it's ~/Library/Preferences/com.apple.WebKit.WebContent{.Development}.
> 
> I'll take out the InjectedBundle change if everything else is OK.

Now that I look at the other parts, I am confused. Will kCFPreferencesCurrentApplication look in the global domain if the default isn’t set in the app’s domain? If not, it seems like this would break the normal use case of using System Preferences to change this setting.

Why can’t WebKit just use [NSUserDefaults standardUserDefaults] now that it doesn’t need to look in the Universal Access domain?
Comment 17 Alexey Proskuryakov 2013-11-04 22:31:57 PST
> Will kCFPreferencesCurrentApplication look in the global domain if the default isn’t set in the app’s domain? 

Yes, when used with CFPreferencesGetAppIntegerValue. Presumably not with CFPreferencesCopyValue, although I didn't check that.

These "app" functions are exactly what NSUserDefaults use inside.

If I comment out "@"AppleKeyboardUIMode": @1," in DRT, then platform/mac/fast/forms/focus-option-control-on-page.html regression test starts to depend on system preference for FKA.

> Why can’t WebKit just use [NSUserDefaults standardUserDefaults] now that it doesn’t need to look in the Universal Access domain?

Yes, it could. I don't think that there is any reason to, CFPreferences is exactly the same thing, but it avoids some function call overhead.
Comment 18 mitz 2013-11-04 22:36:02 PST
Comment on attachment 215892 [details]
how about this?

r=me without the WKTR Injected Bundle change
Comment 19 Alexey Proskuryakov 2013-11-04 23:04:15 PST
Committed <http://trac.webkit.org/r158652>.