Title: [281498] trunk/Tools
Revision
281498
Author
[email protected]
Date
2021-08-24 10:47:00 -0700 (Tue, 24 Aug 2021)

Log Message

REGRESSION (r281473): [ iOS & MacOS ] TestWebKitAPI.ProcessSwap.NavigateToInvalidURL is timing out
https://bugs.webkit.org/show_bug.cgi?id=229447

Patch by Alex Christensen <[email protected]> on 2021-08-24
Reviewed by Chris Dumez.

Check that a JS error was thrown instead of checking that the navigation doesn't go through.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (281497 => 281498)


--- trunk/Tools/ChangeLog	2021-08-24 17:41:44 UTC (rev 281497)
+++ trunk/Tools/ChangeLog	2021-08-24 17:47:00 UTC (rev 281498)
@@ -1,3 +1,14 @@
+2021-08-24  Alex Christensen  <[email protected]>
+
+        REGRESSION (r281473): [ iOS & MacOS ] TestWebKitAPI.ProcessSwap.NavigateToInvalidURL is timing out
+        https://bugs.webkit.org/show_bug.cgi?id=229447
+
+        Reviewed by Chris Dumez.
+
+        Check that a JS error was thrown instead of checking that the navigation doesn't go through.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
+
 2021-08-23  John Wilander  <[email protected]>
 
         PCM: Support ephemeral measurement with non-persistent WebCore::PrivateClickMeasurement

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm (281497 => 281498)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm	2021-08-24 17:41:44 UTC (rev 281497)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm	2021-08-24 17:47:00 UTC (rev 281498)
@@ -4653,10 +4653,14 @@
 
     EXPECT_EQ(1, numberOfDecidePolicyCalls);
 
-    [webView evaluateJavaScript:@"location.href = ''" completionHandler:nil];
+    __block bool evaluated = false;
+    [webView evaluateJavaScript:@"var err = 'no error'; try { location.href = '' } catch(e) { err=e; }; err.message" completionHandler:^(id result, NSError *error) {
+        EXPECT_WK_STREQ(result, "Invalid URL");
+        EXPECT_NULL(error);
+        evaluated = true;
+    }];
 
-    didRepondToPolicyDecisionCall = false;
-    TestWebKitAPI::Util::run(&didRepondToPolicyDecisionCall);
+    TestWebKitAPI::Util::run(&evaluated);
 
     TestWebKitAPI::Util::spinRunLoop(1);
 
@@ -4663,7 +4667,7 @@
     auto pid2 = [webView _webProcessIdentifier];
     EXPECT_TRUE(!!pid2);
 
-    EXPECT_EQ(2, numberOfDecidePolicyCalls);
+    EXPECT_EQ(1, numberOfDecidePolicyCalls);
     EXPECT_EQ(pid1, pid2);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to