Web Automation: remove unnecessary member variable WebAutomationSession
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2018 20:22:36 +0000 (20:22 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2018 20:22:36 +0000 (20:22 +0000)
commitb34cb93dd9362979c294f01e744270ed45eb0f25
tree0fadb47e8d6b8aad65db7f30e83dd6562efb352c
parent8a29fa104ce88ddfc8172f5cace126659beaaeb6
Web Automation: remove unnecessary member variable WebAutomationSession
https://bugs.webkit.org/show_bug.cgi?id=183971

Reviewed by Timothy Hatcher.

The concept of the "active" browsing context is something in the WebDriver
specification, but we were a bit too literal when first implementing this.
There's no actual need for this on the browser side since most commands
require implicitly switching to the target window passed in with the
Automation command. The driver, however, still needs to track the current
browsing context and current top-level browsing context.

For returning whether a browsing context is active,  we can just look at
the page's activity state to know whether the page is active or not. For
a normal browser, only one page is going to be visible and focused at a time.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::buildBrowsingContextForPage):
Consult the page's activity state to determine whether it's active.

(WebKit::WebAutomationSession::createBrowsingContext):
(WebKit::WebAutomationSession::closeBrowsingContext):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::handleRunOpenPanel):
Stop reading and writing the current browsing context handle.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isViewFocused const):
(WebKit::WebPageProxy::isViewWindowActive const):
Add new accessor.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229964 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit/UIProcess/Automation/WebAutomationSession.h
Source/WebKit/UIProcess/WebPageProxy.h