Changeset 220604 in webkit


Ignore:
Timestamp:
Aug 11, 2017 10:30:46 AM (7 years ago)
Author:
Jonathan Bedard
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.

Location:
trunk/Tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r220601 r220604  
     12017-08-11  Jonathan Bedard  <jbedard@apple.com>
     2
     3        Create mock ITP data in testing to prevent grandfathering
     4        https://bugs.webkit.org/show_bug.cgi?id=174720
     5        <rdar://problem/33457779>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        We don't need to be triggering grandfathering when each test runner starts. On Mac,
     10        this may launch plugins which can cause layout tests to fail later if the test
     11        runner does not shut-down before the plugins unload.
     12
     13        * WebKitTestRunner/TestController.h: Add declaration of cocoaPlatformInitialize.
     14        * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
     15        (WTR::TestController::cocoaPlatformInitialize): Write the minimum data required to
     16        prevent grandfathering from being triggered.
     17        * WebKitTestRunner/ios/TestControllerIOS.mm:
     18        (WTR::TestController::platformInitialize): Call cocoaPlatformInitialize.
     19        * WebKitTestRunner/mac/TestControllerMac.mm:
     20        (WTR::TestController::platformInitialize): Ditto.
     21
    1222017-08-11  Sam Weinig  <sam@webkit.org>
    223
  • trunk/Tools/WebKitTestRunner/TestController.h

    r220412 r220604  
    205205    void platformResetStateToConsistentValues();
    206206#if PLATFORM(COCOA)
     207    void cocoaPlatformInitialize();
    207208    void cocoaResetStateToConsistentValues();
    208209#endif
  • trunk/Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm

    r220412 r220604  
    9494}
    9595
     96void TestController::cocoaPlatformInitialize()
     97{
     98    const char* dumpRenderTreeTemp = libraryPathForTesting();
     99    if (!dumpRenderTreeTemp)
     100        return;
     101
     102    String resourceLoadStatisticsFolder = String(dumpRenderTreeTemp) + '/' + "ResourceLoadStatistics";
     103    [[NSFileManager defaultManager] createDirectoryAtPath:resourceLoadStatisticsFolder withIntermediateDirectories:NO attributes:nil error: nil];
     104    String fullBrowsingSessionResourceLog = resourceLoadStatisticsFolder + '/' + "full_browsing_session_resourceLog.plist";
     105    NSDictionary *resourceLogPlist = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt:1], @"version", nil];
     106    if (![resourceLogPlist writeToFile:fullBrowsingSessionResourceLog atomically:YES])
     107        WTFCrash();
     108}
     109
    96110WKContextRef TestController::platformContext()
    97111{
  • trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm

    r218275 r220604  
    5252{
    5353    setUpIOSLayoutTestCommunication();
     54    cocoaPlatformInitialize();
     55
    5456    [UIApplication sharedApplication].idleTimerDisabled = YES;
    5557    [[UIScreen mainScreen] _setScale:2.0];
  • trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm

    r212876 r220604  
    6767    poseAsClass("WebKitTestRunnerPasteboard", "NSPasteboard");
    6868    poseAsClass("WebKitTestRunnerEvent", "NSEvent");
     69   
     70    cocoaPlatformInitialize();
    6971
    7072    [NSSound _setAlertType:0];
Note: See TracChangeset for help on using the changeset viewer.