Title: [220604] trunk/Tools
Revision
220604
Author
jbed...@apple.com
Date
2017-08-11 10:30:46 -0700 (Fri, 11 Aug 2017)

Log Message

Create mock ITP data in testing to prevent grandfathering
https://bugs.webkit.org/show_bug.cgi?id=174720
<rdar://problem/33457779>

Reviewed by Brent Fulgham.

We don't need to be triggering grandfathering when each test runner starts. On Mac,
this may launch plugins which can cause layout tests to fail later if the test
runner does not shut-down before the plugins unload.

* WebKitTestRunner/TestController.h: Add declaration of cocoaPlatformInitialize.
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaPlatformInitialize): Write the minimum data required to
prevent grandfathering from being triggered.
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformInitialize): Call cocoaPlatformInitialize.
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::platformInitialize): Ditto.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (220603 => 220604)


--- trunk/Tools/ChangeLog	2017-08-11 17:26:59 UTC (rev 220603)
+++ trunk/Tools/ChangeLog	2017-08-11 17:30:46 UTC (rev 220604)
@@ -1,3 +1,24 @@
+2017-08-11  Jonathan Bedard  <jbed...@apple.com>
+
+        Create mock ITP data in testing to prevent grandfathering
+        https://bugs.webkit.org/show_bug.cgi?id=174720
+        <rdar://problem/33457779>
+
+        Reviewed by Brent Fulgham.
+
+        We don't need to be triggering grandfathering when each test runner starts. On Mac,
+        this may launch plugins which can cause layout tests to fail later if the test
+        runner does not shut-down before the plugins unload.
+
+        * WebKitTestRunner/TestController.h: Add declaration of cocoaPlatformInitialize.
+        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
+        (WTR::TestController::cocoaPlatformInitialize): Write the minimum data required to
+        prevent grandfathering from being triggered.
+        * WebKitTestRunner/ios/TestControllerIOS.mm:
+        (WTR::TestController::platformInitialize): Call cocoaPlatformInitialize.
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::TestController::platformInitialize): Ditto.
+
 2017-08-11  Sam Weinig  <s...@webkit.org>
 
         WTF::Function does not allow for reference / non-default constructible return types

Modified: trunk/Tools/WebKitTestRunner/TestController.h (220603 => 220604)


--- trunk/Tools/WebKitTestRunner/TestController.h	2017-08-11 17:26:59 UTC (rev 220603)
+++ trunk/Tools/WebKitTestRunner/TestController.h	2017-08-11 17:30:46 UTC (rev 220604)
@@ -204,6 +204,7 @@
     void platformResetPreferencesToConsistentValues();
     void platformResetStateToConsistentValues();
 #if PLATFORM(COCOA)
+    void cocoaPlatformInitialize();
     void cocoaResetStateToConsistentValues();
 #endif
     void platformConfigureViewForTest(const TestInvocation&);

Modified: trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm (220603 => 220604)


--- trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2017-08-11 17:26:59 UTC (rev 220603)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm	2017-08-11 17:30:46 UTC (rev 220604)
@@ -93,6 +93,20 @@
 #endif
 }
 
+void TestController::cocoaPlatformInitialize()
+{
+    const char* dumpRenderTreeTemp = libraryPathForTesting();
+    if (!dumpRenderTreeTemp)
+        return;
+
+    String resourceLoadStatisticsFolder = String(dumpRenderTreeTemp) + '/' + "ResourceLoadStatistics";
+    [[NSFileManager defaultManager] createDirectoryAtPath:resourceLoadStatisticsFolder withIntermediateDirectories:NO attributes:nil error: nil];
+    String fullBrowsingSessionResourceLog = resourceLoadStatisticsFolder + '/' + "full_browsing_session_resourceLog.plist";
+    NSDictionary *resourceLogPlist = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:1], @"version", nil];
+    if (![resourceLogPlist writeToFile:fullBrowsingSessionResourceLog atomically:YES])
+        WTFCrash();
+}
+
 WKContextRef TestController::platformContext()
 {
 #if WK_API_ENABLED

Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (220603 => 220604)


--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2017-08-11 17:26:59 UTC (rev 220603)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm	2017-08-11 17:30:46 UTC (rev 220604)
@@ -51,6 +51,8 @@
 void TestController::platformInitialize()
 {
     setUpIOSLayoutTestCommunication();
+    cocoaPlatformInitialize();
+
     [UIApplication sharedApplication].idleTimerDisabled = YES;
     [[UIScreen mainScreen] _setScale:2.0];
 }

Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (220603 => 220604)


--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm	2017-08-11 17:26:59 UTC (rev 220603)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm	2017-08-11 17:30:46 UTC (rev 220604)
@@ -66,6 +66,8 @@
 {
     poseAsClass("WebKitTestRunnerPasteboard", "NSPasteboard");
     poseAsClass("WebKitTestRunnerEvent", "NSEvent");
+    
+    cocoaPlatformInitialize();
 
     [NSSound _setAlertType:0];
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to