Title: [227601] trunk/Source/WebKit
Revision
227601
Author
[email protected]
Date
2018-01-25 05:50:07 -0800 (Thu, 25 Jan 2018)

Log Message

WebDriver: test imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py crashes in debug
https://bugs.webkit.org/show_bug.cgi?id=182096

Reviewed by Carlos Alberto Lopez Perez.

It's an assert in HashTable iterators checkValidity(). The problem is that we get the keys to iterate the values
and the map is modified inside the loop. We need to use copyToVector to copy the keys.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
(WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
(WebKit::WebAutomationSession::willShowJavaScriptDialog):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (227600 => 227601)


--- trunk/Source/WebKit/ChangeLog	2018-01-25 13:26:46 UTC (rev 227600)
+++ trunk/Source/WebKit/ChangeLog	2018-01-25 13:50:07 UTC (rev 227601)
@@ -1,3 +1,18 @@
+2018-01-25  Carlos Garcia Campos  <[email protected]>
+
+        WebDriver: test imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py crashes in debug
+        https://bugs.webkit.org/show_bug.cgi?id=182096
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        It's an assert in HashTable iterators checkValidity(). The problem is that we get the keys to iterate the values
+        and the map is modified inside the loop. We need to use copyToVector to copy the keys.
+
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
+        (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
+        (WebKit::WebAutomationSession::willShowJavaScriptDialog):
+
 2018-01-24  Alex Christensen  <[email protected]>
 
         Gracefully recover from NetworkProcess crashes in private browsing

Modified: trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp (227600 => 227601)


--- trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2018-01-25 13:26:46 UTC (rev 227600)
+++ trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp	2018-01-25 13:50:07 UTC (rev 227601)
@@ -508,7 +508,7 @@
 void WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout(HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>>& map)
 {
     Inspector::ErrorString timeoutError = STRING_FOR_PREDEFINED_ERROR_NAME(Timeout);
-    for (auto id : map.keys()) {
+    for (auto id : copyToVector(map.keys())) {
         auto page = WebProcessProxy::webPage(id);
         auto callback = map.take(id);
         if (page && m_client->isShowingJavaScriptDialogOnPage(*this, *page))
@@ -530,7 +530,7 @@
 void WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout(HashMap<uint64_t, RefPtr<Inspector::BackendDispatcher::CallbackBase>>& map)
 {
     Inspector::ErrorString timeoutError = STRING_FOR_PREDEFINED_ERROR_NAME(Timeout);
-    for (auto id : map.keys()) {
+    for (auto id : copyToVector(map.keys())) {
         auto* page = findPageForFrameID(*m_processPool, id);
         auto callback = map.take(id);
         if (page && m_client->isShowingJavaScriptDialogOnPage(*this, *page))
@@ -566,7 +566,7 @@
 
         if (!m_evaluateJavaScriptFunctionCallbacks.isEmpty()) {
             Inspector::ErrorString unexpectedAlertOpenError = STRING_FOR_PREDEFINED_ERROR_NAME(UnexpectedAlertOpen);
-            for (auto key : m_evaluateJavaScriptFunctionCallbacks.keys()) {
+            for (auto key : copyToVector(m_evaluateJavaScriptFunctionCallbacks.keys())) {
                 auto callback = m_evaluateJavaScriptFunctionCallbacks.take(key);
                 callback->sendFailure(unexpectedAlertOpenError);
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to