Changeset 213790 in webkit

Timestamp:
Mar 13, 2017, 2:21:34 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Web Automation: automation commands hang when trying to navigate go/back and it's not possible
https://bugs.webkit.org/show_bug.cgi?id=169407

Reviewed by Michael Catanzaro.

Trying to navigate back or forward when there are no back/forward items makes the automation commands to hang, because
navigation callback is never called. WebPageProxy returns nullptr to indicate no navigation will take place. In
that case we can consider that the operation succeeded.

  • UIProcess/Automation/WebAutomationSession.cpp:

(WebKit::WebAutomationSession::goBackInBrowsingContext):
(WebKit::WebAutomationSession::goForwardInBrowsingContext):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r213787 r213790  
     1
     2
     3
     4
     5
     6
     7
     8
     9
     10
     11
     12
     13
     14
     15
    1162017-03-13  Zan Dobersek  <zdobersek@igalia.com>
    217
  • trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp

    r213759 r213790  
    310310    if (auto callback = m_pendingNavigationInBrowsingContextCallbacksPerPage.take(page->pageID()))
    311311        callback->sendFailure(STRING_FOR_PREDEFINED_ERROR_NAME(Timeout));
    312     m_pendingNavigationInBrowsingContextCallbacksPerPage.set(page->pageID(), WTFMove(callback));
    313 
    314     page->goBack();
     312
     313    if (page->goBack())
     314        m_pendingNavigationInBrowsingContextCallbacksPerPage.set(page->pageID(), WTFMove(callback));
     315    else
     316        callback->sendSuccess();
    315317}
    316318
     
    323325    if (auto callback = m_pendingNavigationInBrowsingContextCallbacksPerPage.take(page->pageID()))
    324326        callback->sendFailure(STRING_FOR_PREDEFINED_ERROR_NAME(Timeout));
    325     m_pendingNavigationInBrowsingContextCallbacksPerPage.set(page->pageID(), WTFMove(callback));
    326 
    327     page->goForward();
     327
     328    if (page->goForward())
     329        m_pendingNavigationInBrowsingContextCallbacksPerPage.set(page->pageID(), WTFMove(callback));
     330    else
     331        callback->sendSuccess();
    328332}
    329333
Note: See TracChangeset for help on using the changeset viewer.