Title: [283714] trunk/Tools
Revision
283714
Author
[email protected]
Date
2021-10-07 08:20:34 -0700 (Thu, 07 Oct 2021)

Log Message

REGRESSION (r283613): [ macOS ] TestWebKitAPI.ResourceLoadDelegate.LoadInfo is failing
https://bugs.webkit.org/show_bug.cgi?id=231303
<rdar://problem/83940067>

Reviewed by Chris Dumez.

Make sure to clear all data store at the end of PushAPI test, as well as at the beginning of ResourceLoadDelegate test.

* TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm:
* TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (283713 => 283714)


--- trunk/Tools/ChangeLog	2021-10-07 15:16:51 UTC (rev 283713)
+++ trunk/Tools/ChangeLog	2021-10-07 15:20:34 UTC (rev 283714)
@@ -1,3 +1,16 @@
+2021-10-07  Youenn Fablet  <[email protected]>
+
+        REGRESSION (r283613): [ macOS ] TestWebKitAPI.ResourceLoadDelegate.LoadInfo is failing
+        https://bugs.webkit.org/show_bug.cgi?id=231303
+        <rdar://problem/83940067>
+
+        Reviewed by Chris Dumez.
+
+        Make sure to clear all data store at the end of PushAPI test, as well as at the beginning of ResourceLoadDelegate test.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm:
+        * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm:
+
 2021-10-07  David Kilzer  <[email protected]>
 
         Add back RetainPtrARC and TypeCastsCocoaARC tests to TestWTF

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm (283713 => 283714)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm	2021-10-07 15:16:51 UTC (rev 283713)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm	2021-10-07 15:20:34 UTC (rev 283714)
@@ -94,6 +94,15 @@
 });
 )SWRESOURCE";
 
+static void clearWebsiteDataStore(WKWebsiteDataStore *store)
+{
+    __block bool clearedStore = false;
+    [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() {
+        clearedStore = true;
+    }];
+    TestWebKitAPI::Util::run(&clearedStore);
+}
+
 static bool pushMessageProcessed = false;
 static bool pushMessageSuccessful = false;
 TEST(PushAPI, firePushEvent)
@@ -110,11 +119,7 @@
     auto messageHandler = adoptNS([[PushAPIMessageHandlerWithExpectedMessage alloc] init]);
     [[configuration userContentController] addScriptMessageHandler:messageHandler.get() name:@"sw"];
 
-    [[configuration websiteDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() {
-        done = true;
-    }];
-    TestWebKitAPI::Util::run(&done);
-    done = false;
+    clearWebsiteDataStore([configuration websiteDataStore]);
 
     expectedMessage = "Ready";
     auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
@@ -149,4 +154,6 @@
 
     TestWebKitAPI::Util::run(&pushMessageProcessed);
     EXPECT_FALSE(pushMessageSuccessful);
+
+    clearWebsiteDataStore([configuration websiteDataStore]);
 }

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm (283713 => 283714)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm	2021-10-07 15:16:51 UTC (rev 283713)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadDelegate.mm	2021-10-07 15:20:34 UTC (rev 283714)
@@ -248,6 +248,12 @@
 
 TEST(ResourceLoadDelegate, LoadInfo)
 {
+    __block bool clearedStore = false;
+    [[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() {
+        clearedStore = true;
+    }];
+    TestWebKitAPI::Util::run(&clearedStore);
+
     TestWebKitAPI::HTTPServer server({
         { "/", { "<iframe src=''></iframe>" } },
         { "/iframeSrc", { "<script>fetch('fetchTarget', { body: 'a=b&c=d', method: 'post'})</script>" } },
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to