Title: [260446] trunk
Revision
260446
Author
timo...@apple.com
Date
2020-04-21 11:42:45 -0700 (Tue, 21 Apr 2020)

Log Message

Reset m_userScriptsNotified when web process crashes.
https://bugs.webkit.org/show_bug.cgi?id=210807

Reviewed by Alex Christensen.

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebPageProxy::resetStateAfterProcessExited): Set m_userScriptsNotified to false.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST): Test crashing the web process and reloading.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (260445 => 260446)


--- trunk/Source/WebKit/ChangeLog	2020-04-21 18:17:10 UTC (rev 260445)
+++ trunk/Source/WebKit/ChangeLog	2020-04-21 18:42:45 UTC (rev 260446)
@@ -1,3 +1,13 @@
+2020-04-21  Timothy Hatcher  <timo...@apple.com>
+
+        Reset m_userScriptsNotified when web process crashes.
+        https://bugs.webkit.org/show_bug.cgi?id=210807
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebPageProxy::resetStateAfterProcessExited): Set m_userScriptsNotified to false.
+
 2020-04-21  Timothy Horton  <timothy_hor...@apple.com>
 
         Fix the build

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (260445 => 260446)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-04-21 18:17:10 UTC (rev 260445)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-04-21 18:42:45 UTC (rev 260446)
@@ -7661,6 +7661,8 @@
     m_hasRunningProcess = false;
     m_isPageSuspended = false;
 
+    m_userScriptsNotified = false;
+
     m_editorState = EditorState();
     m_cachedFontAttributesAtSelectionStart.reset();
 

Modified: trunk/Tools/ChangeLog (260445 => 260446)


--- trunk/Tools/ChangeLog	2020-04-21 18:17:10 UTC (rev 260445)
+++ trunk/Tools/ChangeLog	2020-04-21 18:42:45 UTC (rev 260446)
@@ -1,3 +1,13 @@
+2020-04-21  Timothy Hatcher  <timo...@apple.com>
+
+        Reset m_userScriptsNotified when web process crashes.
+        https://bugs.webkit.org/show_bug.cgi?id=210807
+
+        Reviewed by Alex Christensen.
+
+        * TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
+        (TEST): Test crashing the web process and reloading.
+
 2020-04-21  Aakash Jain  <aakash_j...@apple.com>
 
         [ews] Display error message when submit for EWS analysis button doesn't work

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm (260445 => 260446)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm	2020-04-21 18:17:10 UTC (rev 260445)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm	2020-04-21 18:42:45 UTC (rev 260446)
@@ -902,10 +902,26 @@
     webView1.UIDelegate = delegate;
     [webView1 loadTestPageNamed:@"simple"];
     EXPECT_WK_STREQ([delegate waitForAlert], "document parsing ended");
+    EXPECT_TRUE(webView1._deferrableUserScriptsNeedNotification);
     [webView1 _notifyUserScripts];
     EXPECT_FALSE(webView1._deferrableUserScriptsNeedNotification);
     EXPECT_WK_STREQ([delegate waitForAlert], "waited for notification");
 
+    [webView1 _killWebContentProcessAndResetState];
+    [webView1 reload];
+
+    EXPECT_WK_STREQ([delegate waitForAlert], "document parsing ended");
+    EXPECT_TRUE(webView1._deferrableUserScriptsNeedNotification);
+    [webView1 _notifyUserScripts];
+    EXPECT_FALSE(webView1._deferrableUserScriptsNeedNotification);
+    EXPECT_WK_STREQ([delegate waitForAlert], "waited for notification");
+
+    [webView1 reload];
+
+    EXPECT_FALSE(webView1._deferrableUserScriptsNeedNotification);
+    EXPECT_WK_STREQ([delegate waitForAlert], "waited for notification");
+    EXPECT_WK_STREQ([delegate waitForAlert], "document parsing ended");
+
     WKWebViewConfiguration *configuration = [[WKWebViewConfiguration new] autorelease];
     EXPECT_TRUE(configuration._deferrableUserScriptsShouldWaitUntilNotification);
     configuration._deferrableUserScriptsShouldWaitUntilNotification = NO;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to