You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[GTK][WPE] Add API to provide browser information required by automation
https://bugs.webkit.org/show_bug.cgi?id=175130
Source/JavaScriptCore:
Reviewed by Brian Burg.
Add browserName and browserVersion to RemoteInspector::Client::Capabilities and virtual methods to the Client to
get them.
* inspector/remote/RemoteInspector.cpp:
(Inspector::RemoteInspector::updateClientCapabilities): Update also browserName and browserVersion.
* inspector/remote/RemoteInspector.h:
* inspector/remote/glib/RemoteInspectorGlib.cpp:
(Inspector::RemoteInspector::requestAutomationSession): Call updateClientCapabilities() after the session is
requested to ensure they are updated before StartAutomationSession reply is sent.
* inspector/remote/glib/RemoteInspectorServer.cpp: Add browserName and browserVersion as return values of
StartAutomationSession mesasage.
Source/WebDriver:
Reviewed by Brian Burg.
* Session.cpp:
(WebDriver::Session::createTopLevelBrowsingContext): Check if startAutomationSession and complete the command
with error in that case.
* SessionHost.h:
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::matchCapabilities): Match the capabilities that are known only after the browser has
been launched.
(WebDriver::SessionHost::startAutomationSession): Handle the StartAutomationSession response, extracting the
capabilities and calling matchCapabilities() to match them.
(WebDriver::SessionHost::setTargetList): Return early if the session was rejected before due to invalid
capabilities.
Source/WebKit:
Reviewed by Michael Catanzaro.
When a new automation session is started, the web driver receives some required capabilities from the client,
like browser name and version. The session should be rejected if those required capabilities don't match with
the actual browser that is launched. We don't know that information in WebKit, so we need to add API so that
users can provide it when a new session request is made. This patch adds boxed object WebKitApplicationInfo that
can be used to set the application name and version. This object can be set to a WebKitAutomationSession when
WebKitWebContext::automation-started signal is emitted.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* UIProcess/API/glib/WebKitApplicationInfo.cpp: Added.
(webkit_application_info_new):
(webkit_application_info_ref):
(webkit_application_info_unref):
(webkit_application_info_set_name):
(webkit_application_info_get_name):
(webkit_application_info_set_version):
(webkit_application_info_get_version):
* UIProcess/API/glib/WebKitAutomationSession.cpp:
(webkitAutomationSessionDispose):
(webkit_automation_session_class_init):
(webkitAutomationSessionGetBrowserName):
(webkitAutomationSessionGetBrowserVersion):
(webkit_automation_session_set_application_info):
(webkit_automation_session_get_application_info):
* UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
* UIProcess/API/glib/WebKitWebContext.cpp:
* UIProcess/API/gtk/WebKitApplicationInfo.h: Added.
* UIProcess/API/gtk/WebKitAutomationSession.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitApplicationInfo.h: Added.
* UIProcess/API/wpe/WebKitAutomationSession.h:
* UIProcess/API/wpe/webkit.h:
Tools:
Reviewed by Michael Catanzaro.
* MiniBrowser/gtk/main.c:
(automationStartedCallback): Set browser information when a new automation session is started.
* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
(testAutomationSessionApplicationInfo):
(beforeAll):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@220329 268f45cc-cd09-0410-ab3c-d52691b4dbfc
0 commit comments