Title: [232111] trunk/Source
Revision
232111
Author
[email protected]
Date
2018-05-23 08:24:58 -0700 (Wed, 23 May 2018)

Log Message

[GTK] WebDriver: implement AutomationSessionClient::didDisconnectFromRemote
https://bugs.webkit.org/show_bug.cgi?id=185866

Reviewed by Brian Burg.

Source/WebDriver:

Close the dbus connection when receiving an empty target list.

* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::setTargetList):

Source/WebKit:

To handle the case of the session being closed by the browser, for example in case of a network process
crash. This is currently causing WebDriver tests to timeout in the bot.

* UIProcess/API/glib/WebKitAutomationSession.cpp: Add an implementation of didDisconnectFromRemote() to notify
the WebContext that the session will be closed.
* UIProcess/API/glib/WebKitWebContext.cpp: Remove the automation session when closed.
* UIProcess/API/glib/WebKitWebContextPrivate.h:

Modified Paths

Diff

Modified: trunk/Source/WebDriver/ChangeLog (232110 => 232111)


--- trunk/Source/WebDriver/ChangeLog	2018-05-23 15:18:30 UTC (rev 232110)
+++ trunk/Source/WebDriver/ChangeLog	2018-05-23 15:24:58 UTC (rev 232111)
@@ -1,3 +1,15 @@
+2018-05-23  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] WebDriver: implement AutomationSessionClient::didDisconnectFromRemote
+        https://bugs.webkit.org/show_bug.cgi?id=185866
+
+        Reviewed by Brian Burg.
+
+        Close the dbus connection when receiving an empty target list.
+
+        * glib/SessionHostGlib.cpp:
+        (WebDriver::SessionHost::setTargetList):
+
 2018-05-21  Olivier Blin  <[email protected]>
 
         [WPE][WebDriver] add ICU include dirs

Modified: trunk/Source/WebDriver/glib/SessionHostGlib.cpp (232110 => 232111)


--- trunk/Source/WebDriver/glib/SessionHostGlib.cpp	2018-05-23 15:18:30 UTC (rev 232110)
+++ trunk/Source/WebDriver/glib/SessionHostGlib.cpp	2018-05-23 15:24:58 UTC (rev 232111)
@@ -306,6 +306,8 @@
     if (targetList.isEmpty()) {
         m_target = Target();
         m_connectionID = 0;
+        if (m_dbusConnection)
+            g_dbus_connection_close(m_dbusConnection.get(), nullptr, nullptr, nullptr);
         return;
     }
 

Modified: trunk/Source/WebKit/ChangeLog (232110 => 232111)


--- trunk/Source/WebKit/ChangeLog	2018-05-23 15:18:30 UTC (rev 232110)
+++ trunk/Source/WebKit/ChangeLog	2018-05-23 15:24:58 UTC (rev 232111)
@@ -1,3 +1,18 @@
+2018-05-23  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] WebDriver: implement AutomationSessionClient::didDisconnectFromRemote
+        https://bugs.webkit.org/show_bug.cgi?id=185866
+
+        Reviewed by Brian Burg.
+
+        To handle the case of the session being closed by the browser, for example in case of a network process
+        crash. This is currently causing WebDriver tests to timeout in the bot.
+
+        * UIProcess/API/glib/WebKitAutomationSession.cpp: Add an implementation of didDisconnectFromRemote() to notify
+        the WebContext that the session will be closed.
+        * UIProcess/API/glib/WebKitWebContext.cpp: Remove the automation session when closed.
+        * UIProcess/API/glib/WebKitWebContextPrivate.h:
+
 2018-05-22  Brent Fulgham  <[email protected]>
 
         Close access to "lsopen" for non-UI process

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp (232110 => 232111)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp	2018-05-23 15:18:30 UTC (rev 232110)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitAutomationSession.cpp	2018-05-23 15:24:58 UTC (rev 232111)
@@ -82,6 +82,11 @@
         return String::fromUTF8(m_session->priv->id.data());
     }
 
+    void didDisconnectFromRemote(WebAutomationSession&) override
+    {
+        webkitWebContextWillCloseAutomationSession(m_session->priv->webContext);
+    }
+
     void requestNewPageWithOptions(WebAutomationSession&, API::AutomationSessionBrowsingContextOptions, CompletionHandler<void(WebPageProxy*)>&& completionHandler) override
     {
         WebKitWebView* webView = nullptr;

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp (232110 => 232111)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp	2018-05-23 15:18:30 UTC (rev 232110)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp	2018-05-23 15:24:58 UTC (rev 232111)
@@ -242,6 +242,12 @@
 
     WebKitWebContext* m_webContext;
 };
+
+void webkitWebContextWillCloseAutomationSession(WebKitWebContext* webContext)
+{
+    webContext->priv->processPool->setAutomationSession(nullptr);
+    webContext->priv->automationSession = nullptr;
+}
 #endif // ENABLE(REMOTE_INSPECTOR)
 
 WEBKIT_DEFINE_TYPE(WebKitWebContext, webkit_web_context, G_TYPE_OBJECT)

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContextPrivate.h (232110 => 232111)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContextPrivate.h	2018-05-23 15:18:30 UTC (rev 232110)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContextPrivate.h	2018-05-23 15:24:58 UTC (rev 232111)
@@ -47,3 +47,6 @@
 WebKitWebView* webkitWebContextGetWebViewForPage(WebKitWebContext*, WebKit::WebPageProxy*);
 GVariant* webkitWebContextInitializeWebExtensions(WebKitWebContext*);
 void webkitWebContextInitializeNotificationPermissions(WebKitWebContext*);
+#if ENABLE(REMOTE_INSPECTOR)
+void webkitWebContextWillCloseAutomationSession(WebKitWebContext*);
+#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to