Web Automation: Navigation commands should not return until page loads or fails
https://bugs.webkit.org/show_bug.cgi?id=156063
rdar://problem/25464373
Reviewed by Brian Burg.
* UIProcess/Automation/Automation.json: Make navigation commands async.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::navigateBrowsingContext): Save callback and timeout previous.
(WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
(WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
(WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
(WebKit::WebAutomationSession::navigationOccuredForPage): Added. Fire callback for page.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishLoadForFrame): Call WebAutomationSession::navigationOccuredForPage.
(WebKit::WebPageProxy::didFailLoadForFrame): Ditto.
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Ditto.
* UIProcess/WebProcessPool.h: Added automationSession() getter.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@198914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
6 files changed