Title: [240509] trunk/Tools
Revision
240509
Author
bfulg...@apple.com
Date
2019-01-25 14:21:38 -0800 (Fri, 25 Jan 2019)

Log Message

Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=193297
<rdar://problem/47158841>

Unreviewed test case fix.

These test cases require ResourceLoadStatistics to be active, so the feature must be turned on.
Previously, the default data store turned the feature on automatically, allowing these tests to pass.

* TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
(TEST):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (240508 => 240509)


--- trunk/Tools/ChangeLog	2019-01-25 22:19:25 UTC (rev 240508)
+++ trunk/Tools/ChangeLog	2019-01-25 22:21:38 UTC (rev 240509)
@@ -1,3 +1,17 @@
+2019-01-25  Brent Fulgham  <bfulg...@apple.com>
+
+        Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
+        https://bugs.webkit.org/show_bug.cgi?id=193297
+        <rdar://problem/47158841>
+
+        Unreviewed test case fix.
+
+        These test cases require ResourceLoadStatistics to be active, so the feature must be turned on.
+        Previously, the default data store turned the feature on automatically, allowing these tests to pass.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
+        (TEST):
+
 2019-01-25  Keith Rollin  <krol...@apple.com>
 
         Update existing .xcfilelists

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm (240508 => 240509)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm	2019-01-25 22:19:25 UTC (rev 240508)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm	2019-01-25 22:21:38 UTC (rev 240509)
@@ -57,11 +57,7 @@
 
 TEST(ResourceLoadStatistics, GrandfatherCallback)
 {
-    // We need an active NetworkProcess to perform ResourceLoadStatistics operations.
-    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
-
     auto *dataStore = [WKWebsiteDataStore defaultDataStore];
-    [dataStore _setResourceLoadStatisticsEnabled:NO];
 
     NSURL *statisticsDirectoryURL = [NSURL fileURLWithPath:[@"~/Library/WebKit/TestWebKitAPI/WebsiteData/ResourceLoadStatistics" stringByExpandingTildeInPath] isDirectory:YES];
     NSURL *fileURL = [statisticsDirectoryURL URLByAppendingPathComponent:@"full_browsing_session_resourceLog.plist"];
@@ -77,6 +73,10 @@
         grandfatheredFlag = true;
     }];
 
+    // We need an active NetworkProcess to perform ResourceLoadStatistics operations.
+    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
+    [dataStore _setResourceLoadStatisticsEnabled:YES];
+
     TestWebKitAPI::Util::run(&grandfatheredFlag);
 
     // Spin the runloop until the resource load statistics file has written to disk.
@@ -121,11 +121,7 @@
 
 TEST(ResourceLoadStatistics, ShouldNotGrandfatherOnStartup)
 {
-    // We need an active NetworkProcess to perform ResourceLoadStatistics operations.
-    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
-
     auto *dataStore = [WKWebsiteDataStore defaultDataStore];
-    [dataStore _setResourceLoadStatisticsEnabled:NO];
 
     NSURL *statisticsDirectoryURL = [NSURL fileURLWithPath:[@"~/Library/WebKit/TestWebKitAPI/WebsiteData/ResourceLoadStatistics" stringByExpandingTildeInPath] isDirectory:YES];
     NSURL *targetURL = [statisticsDirectoryURL URLByAppendingPathComponent:@"full_browsing_session_resourceLog.plist"];
@@ -142,6 +138,10 @@
         callbackFlag = true;
     }];
 
+    // We need an active NetworkProcess to perform ResourceLoadStatistics operations.
+    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
+    [dataStore _setResourceLoadStatisticsEnabled:YES];
+
     TestWebKitAPI::Util::run(&callbackFlag);
 }
 
@@ -152,11 +152,7 @@
 
     EXPECT_EQ((size_t)0, [sharedProcessPool _pluginProcessCount]);
 
-    // We need an active NetworkProcess to perform ResourceLoadStatistics operations.
-    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
-
     auto *dataStore = [WKWebsiteDataStore defaultDataStore];
-    [dataStore _setResourceLoadStatisticsEnabled:NO];
 
     NSURL *statisticsDirectoryURL = [NSURL fileURLWithPath:[@"~/Library/WebKit/TestWebKitAPI/WebsiteData/ResourceLoadStatistics" stringByExpandingTildeInPath] isDirectory:YES];
     NSURL *targetURL = [statisticsDirectoryURL URLByAppendingPathComponent:@"full_browsing_session_resourceLog.plist"];
@@ -173,6 +169,10 @@
         doneFlag = true;
     }];
 
+    // We need an active NetworkProcess to perform ResourceLoadStatistics operations.
+    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]);
+    [dataStore _setResourceLoadStatisticsEnabled:YES];
+
     TestWebKitAPI::Util::run(&doneFlag);
 
     EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:targetURL.path]);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to