REGRESSION (r238294): TestWebKitAPI.WKNavigation.ProcessCrashDuringCallback failing...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 04:23:30 +0000 (04:23 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 04:23:30 +0000 (04:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191783

Reviewed by Chris Dumez.

Allow either WKErrorWebContentProcessTerminated or WKErrorWebViewInvalidated since the test
is closing WebView, thereby invalidating the view, which is racing with the process termination.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238340 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/WebContentProcessDidTerminate.mm

index 0127fba..4b7627b 100644 (file)
@@ -1,3 +1,16 @@
+2018-11-16  Ryosuke Niwa  <rniwa@webkit.org>
+
+        REGRESSION (r238294): TestWebKitAPI.WKNavigation.ProcessCrashDuringCallback failing on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=191783
+
+        Reviewed by Chris Dumez.
+
+        Allow either WKErrorWebContentProcessTerminated or WKErrorWebViewInvalidated since the test
+        is closing WebView, thereby invalidating the view, which is racing with the process termination.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/WebContentProcessDidTerminate.mm:
+        (TEST):
+
 2018-11-16  Chris Dumez  <cdumez@apple.com>
 
         ProcessSwap.DisableForInspector API test is failing
index cd8bab8..e45b649 100644 (file)
@@ -230,21 +230,21 @@ TEST(WKNavigation, ProcessCrashDuringCallback)
     __block WKWebView *view = webView.get();
     [webView _getContentsAsStringWithCompletionHandler:^(NSString *contents, NSError *error) {
         if (!!error)
-            EXPECT_EQ(WKErrorWebContentProcessTerminated, error.code);
+            EXPECT_TRUE(error.code == WKErrorWebContentProcessTerminated || error.code == WKErrorWebViewInvalidated);
         ++callbackCount;
         if (callbackCount == 6)
             calledAllCallbacks = true;
     }];
     [webView _getContentsAsStringWithCompletionHandler:^(NSString *contents, NSError *error) {
         if (!!error)
-            EXPECT_EQ(WKErrorWebContentProcessTerminated, error.code);
+            EXPECT_TRUE(error.code == WKErrorWebContentProcessTerminated || error.code == WKErrorWebViewInvalidated);
         ++callbackCount;
         if (callbackCount == 6)
             calledAllCallbacks = true;
     }];
     [webView _getContentsAsStringWithCompletionHandler:^(NSString *contents, NSError *error) {
         if (!!error)
-            EXPECT_EQ(WKErrorWebContentProcessTerminated, error.code);
+            EXPECT_TRUE(error.code == WKErrorWebContentProcessTerminated || error.code == WKErrorWebViewInvalidated);
         [view _close]; // Calling _close will also invalidate all callbacks.
         ++callbackCount;
         if (callbackCount == 6)
@@ -252,21 +252,21 @@ TEST(WKNavigation, ProcessCrashDuringCallback)
     }];
     [webView _getContentsAsStringWithCompletionHandler:^(NSString *contents, NSError *error) {
         if (!!error)
-            EXPECT_EQ(WKErrorWebContentProcessTerminated, error.code);
+            EXPECT_TRUE(error.code == WKErrorWebContentProcessTerminated || error.code == WKErrorWebViewInvalidated);
         ++callbackCount;
         if (callbackCount == 6)
             calledAllCallbacks = true;
     }];
     [webView _getContentsAsStringWithCompletionHandler:^(NSString *contents, NSError *error) {
         if (!!error)
-            EXPECT_EQ(WKErrorWebContentProcessTerminated, error.code);
+            EXPECT_TRUE(error.code == WKErrorWebContentProcessTerminated || error.code == WKErrorWebViewInvalidated);
         ++callbackCount;
         if (callbackCount == 6)
             calledAllCallbacks = true;
     }];
     [webView _getContentsAsStringWithCompletionHandler:^(NSString *contents, NSError *error) {
         if (!!error)
-            EXPECT_EQ(WKErrorWebContentProcessTerminated, error.code);
+            EXPECT_TRUE(error.code == WKErrorWebContentProcessTerminated || error.code == WKErrorWebViewInvalidated);
         ++callbackCount;
         if (callbackCount == 6)
             calledAllCallbacks = true;