Changeset 227601 in webkit


Ignore:
Timestamp:
Jan 25, 2018 5:50:07 AM (6 years ago)
Author:
Carlos Garcia Campos
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):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r227590 r227601  
     12018-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        WebDriver: test imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py crashes in debug
     4        https://bugs.webkit.org/show_bug.cgi?id=182096
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        It's an assert in HashTable iterators checkValidity(). The problem is that we get the keys to iterate the values
     9        and the map is modified inside the loop. We need to use copyToVector to copy the keys.
     10
     11        * UIProcess/Automation/WebAutomationSession.cpp:
     12        (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
     13        (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
     14        (WebKit::WebAutomationSession::willShowJavaScriptDialog):
     15
    1162018-01-24  Alex Christensen  <achristensen@webkit.org>
    217
  • trunk/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp

    r225501 r227601  
    509509{
    510510    Inspector::ErrorString timeoutError = STRING_FOR_PREDEFINED_ERROR_NAME(Timeout);
    511     for (auto id : map.keys()) {
     511    for (auto id : copyToVector(map.keys())) {
    512512        auto page = WebProcessProxy::webPage(id);
    513513        auto callback = map.take(id);
     
    531531{
    532532    Inspector::ErrorString timeoutError = STRING_FOR_PREDEFINED_ERROR_NAME(Timeout);
    533     for (auto id : map.keys()) {
     533    for (auto id : copyToVector(map.keys())) {
    534534        auto* page = findPageForFrameID(*m_processPool, id);
    535535        auto callback = map.take(id);
     
    567567        if (!m_evaluateJavaScriptFunctionCallbacks.isEmpty()) {
    568568            Inspector::ErrorString unexpectedAlertOpenError = STRING_FOR_PREDEFINED_ERROR_NAME(UnexpectedAlertOpen);
    569             for (auto key : m_evaluateJavaScriptFunctionCallbacks.keys()) {
     569            for (auto key : copyToVector(m_evaluateJavaScriptFunctionCallbacks.keys())) {
    570570                auto callback = m_evaluateJavaScriptFunctionCallbacks.take(key);
    571571                callback->sendFailure(unexpectedAlertOpenError);
Note: See TracChangeset for help on using the changeset viewer.