Title: [158290] trunk/Tools
- Revision
- 158290
- Author
- [email protected]
- Date
- 2013-10-30 11:04:41 -0700 (Wed, 30 Oct 2013)
Log Message
Mavericks: 128 tests are failing due to pixel differences
https://bugs.webkit.org/show_bug.cgi?id=123488
Reviewed by Simon Fraser.
Apple font preferences cannot be fully reset after they've been read, so we
need to set them using CFPreferences before initializing NSApplication.
In theory, this should be an issue on WebKit2 as well, but somehow it doesn't
appear to be. I guess we can figure out the reasons for this difference when/if
any observable problems start to occur.
* DumpRenderTree/mac/DumpRenderTree.mm:
(setDefaultsToConsistentValuesForTesting): Only set defaults here, move other work
to prepareConsistentTestingEnvironment().
(main): Call setDefaultsToConsistentValuesForTesting before [NSApplication sharedApplication]
(which is unnecessary anyway since NSUserDefaults will implicitly call it, but seems
useful to keep in case we change out approach to defaults again).
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (158289 => 158290)
--- trunk/Tools/ChangeLog 2013-10-30 18:02:37 UTC (rev 158289)
+++ trunk/Tools/ChangeLog 2013-10-30 18:04:41 UTC (rev 158290)
@@ -1,3 +1,24 @@
+2013-10-30 Alexey Proskuryakov <[email protected]>
+
+ Mavericks: 128 tests are failing due to pixel differences
+ https://bugs.webkit.org/show_bug.cgi?id=123488
+
+ Reviewed by Simon Fraser.
+
+ Apple font preferences cannot be fully reset after they've been read, so we
+ need to set them using CFPreferences before initializing NSApplication.
+
+ In theory, this should be an issue on WebKit2 as well, but somehow it doesn't
+ appear to be. I guess we can figure out the reasons for this difference when/if
+ any observable problems start to occur.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (setDefaultsToConsistentValuesForTesting): Only set defaults here, move other work
+ to prepareConsistentTestingEnvironment().
+ (main): Call setDefaultsToConsistentValuesForTesting before [NSApplication sharedApplication]
+ (which is unnecessary anyway since NSUserDefaults will implicitly call it, but seems
+ useful to keep in case we change out approach to defaults again).
+
2013-10-29 Andy Estes <[email protected]>
Teach the style checker how to handle Objective-C categories and NS_ENUM
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (158289 => 158290)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2013-10-30 18:02:37 UTC (rev 158289)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2013-10-30 18:04:41 UTC (rev 158290)
@@ -676,12 +676,15 @@
// Called once on DumpRenderTree startup.
static void setDefaultsToConsistentValuesForTesting()
{
- // FIXME: We'd like to start with a clean state for every test, but this function can't be used more than once yet.
- [WebPreferences _switchNetworkLoaderToNewTestingSession];
-
static const int NoFontSmoothing = 0;
static const int BlueTintedAppearance = 1;
+ // These defaults are read at NSApplication initialization time, and there is no way to fully reset them afterwards.
+ // We have to use CFPreferences, because [NSUserDefaults standardUserDefaults] indirectly initializes NSApplication.
+ CFPreferencesSetAppValue(CFSTR("AppleFontSmoothing"), (CFNumberRef)@(NoFontSmoothing), kCFPreferencesCurrentApplication);
+ CFPreferencesSetAppValue(CFSTR("AppleAntiAliasingThreshold"), (CFNumberRef)@4, kCFPreferencesCurrentApplication);
+ CFPreferencesSetAppValue(CFSTR("AppleLanguages"), (CFArrayRef)@[ @"en" ], kCFPreferencesCurrentApplication);
+
NSString *libraryPath = libraryPathForDumpRenderTree();
NSDictionary *dict = @{
@@ -714,17 +717,6 @@
};
[[NSUserDefaults standardUserDefaults] setVolatileDomain:dict forName:NSArgumentDomain];
-
- // Underlying frameworks have already read AppleAntiAliasingThreshold default before we changed it.
- // A distributed notification is delivered to all applications, but it should be harmless, and it's the only way to update all underlying frameworks anyway.
- [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"AppleAquaAntiAliasingChanged" object:nil userInfo:nil deliverImmediately:YES];
-
- NSURLCache *sharedCache =
- [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024
- diskCapacity:0
- diskPath:[libraryPath stringByAppendingPathComponent:@"URLCache"]];
- [NSURLCache setSharedURLCache:sharedCache];
- [sharedCache release];
}
static void runThread(void* arg)
@@ -848,7 +840,16 @@
poseAsClass("DumpRenderTreePasteboard", "NSPasteboard");
poseAsClass("DumpRenderTreeEvent", "NSEvent");
- setDefaultsToConsistentValuesForTesting();
+ // FIXME: We'd like to start with a clean state for every test, but this function can't be used more than once yet.
+ [WebPreferences _switchNetworkLoaderToNewTestingSession];
+
+ NSURLCache *sharedCache =
+ [[NSURLCache alloc] initWithMemoryCapacity:1024 * 1024
+ diskCapacity:0
+ diskPath:[libraryPathForDumpRenderTree() stringByAppendingPathComponent:@"URLCache"]];
+ [NSURLCache setSharedURLCache:sharedCache];
+ [sharedCache release];
+
adjustFonts();
registerMockScrollbars();
@@ -930,6 +931,9 @@
int main(int argc, const char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ setDefaultsToConsistentValuesForTesting(); // Must be called before NSApplication initialization.
+
[DumpRenderTreeApplication sharedApplication]; // Force AppKit to init itself
dumpRenderTree(argc, argv);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes