[webkit-reviews] review denied: [Bug 174720] Create mock ITP data in testing to prevent grandfathering : [Attachment 317187] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 4 09:31:26 PDT 2017


Daniel Bates <dbates at webkit.org> has denied Jonathan Bedard
<jbedard at apple.com>'s request for review:
Bug 174720: Create mock ITP data in testing to prevent grandfathering
https://bugs.webkit.org/show_bug.cgi?id=174720

Attachment 317187: Patch

https://bugs.webkit.org/attachment.cgi?id=317187&action=review




--- Comment #14 from Daniel Bates <dbates at webkit.org> ---
Comment on attachment 317187
  --> https://bugs.webkit.org/attachment.cgi?id=317187
Patch

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

> Tools/WebKitTestRunner/TestController.cpp:424
> +static void writeMockResourceLoadStatistics(const String&
resourceLoadStatisticsFolder)
> +{
> +#if PLATFORM(WIN)
> +    SHCreateDirectoryEx(0, (char*)
resourceLoadStatisticsFolder.characters8(), 0);
> +#else
> +    mkdir((char*) resourceLoadStatisticsFolder.characters8(), 0755);
> +#endif
> +    
> +    String fullBrowsingSessionResourceLog = resourceLoadStatisticsFolder +
'/' + "full_browsing_session_resourceLog.plist";
> +    FILE* tempFile = fopen((char*)
fullBrowsingSessionResourceLog.characters8(), "w");
> +    if (!tempFile)
> +	   WTFCrash();
> +    fprintf(tempFile, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
> +    fprintf(tempFile, "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST
1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n");
> +    fprintf(tempFile, "<plist version=\"1.0\">\n");
> +    fprintf(tempFile, "<dict>\n");
>  
> +    fprintf(tempFile, "<key>version</key>\n");
> +    fprintf(tempFile, "<integer>1</integer>\n");
> +    
> +    fprintf(tempFile, "</dict>\n");
> +    fprintf(tempFile, "</plist>\n");
> +    fclose(tempFile);
> +}

This file is a port-independent file. This is not the appropriate place for
such port-specific logic. It should be in a port-specific file.

> Tools/WebKitTestRunner/TestController.cpp:447
> +	   writeMockResourceLoadStatistics(resourceLoadStatisticsFolder);

Is it necessary to do this every time we create a new web view? Could the
port-specific class(es) for run-webkit-tests create this file as part of
setting up the test tool environment?


More information about the webkit-reviews mailing list