Title: [264390] trunk/Tools
Revision
264390
Author
[email protected]
Date
2020-07-15 01:52:32 -0700 (Wed, 15 Jul 2020)

Log Message

[GTK] API test /webkit/WebKitWebInspectorServer/test-page-list is flaky
https://bugs.webkit.org/show_bug.cgi?id=188115

Reviewed by Michael Catanzaro.

Stop using DBus to connect to the remote inspector and reload the page until we see the inspectable target.

* TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp:
(connectToInspectorServer):
* TestWebKitAPI/glib/TestExpectations.json:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (264389 => 264390)


--- trunk/Tools/ChangeLog	2020-07-15 08:00:13 UTC (rev 264389)
+++ trunk/Tools/ChangeLog	2020-07-15 08:52:32 UTC (rev 264390)
@@ -1,3 +1,16 @@
+2020-07-15  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] API test /webkit/WebKitWebInspectorServer/test-page-list is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=188115
+
+        Reviewed by Michael Catanzaro.
+
+        Stop using DBus to connect to the remote inspector and reload the page until we see the inspectable target.
+
+        * TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp:
+        (connectToInspectorServer):
+        * TestWebKitAPI/glib/TestExpectations.json:
+
 2020-07-14  Wenson Hsieh  <[email protected]>
 
         REGRESSION (r264101): Sharing a link attaches an image instead of the URL

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp (264389 => 264390)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp	2020-07-15 08:00:13 UTC (rev 264389)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGtk/TestInspectorServer.cpp	2020-07-15 08:52:32 UTC (rev 264390)
@@ -51,25 +51,25 @@
 
 static void connectToInspectorServer(GMainLoop* mainLoop)
 {
-    g_dbus_connection_new_for_address("tcp:host=127.0.0.1,port=2999", G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT, nullptr, nullptr,
-        [](GObject* , GAsyncResult* result, gpointer userData) {
-            auto* mainLoop = static_cast<GMainLoop*>(userData);
-            GUniqueOutPtr<GError> error;
-            GRefPtr<GDBusConnection> connection = adoptGRef(g_dbus_connection_new_for_address_finish(result, &error.outPtr()));
-            if (!connection) {
-                if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED)) {
-                    g_timeout_add(100, [](gpointer userData) {
-                        connectToInspectorServer(static_cast<GMainLoop*>(userData));
-                        return G_SOURCE_REMOVE;
-                    }, userData);
-                    return;
-                }
+    GRefPtr<GSocketClient> socketClient = adoptGRef(g_socket_client_new());
+    g_socket_client_connect_to_host_async(socketClient.get(),"127.0.0.1:2999", 0, nullptr, [](GObject* client, GAsyncResult* result, gpointer userData) {
+        auto* mainLoop = static_cast<GMainLoop*>(userData);
+        GUniqueOutPtr<GError> error;
+        GRefPtr<GSocketConnection> connection = adoptGRef(g_socket_client_connect_to_host_finish(G_SOCKET_CLIENT(client), result, &error.outPtr()));
+        if (!connection) {
+            if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CONNECTION_REFUSED)) {
+                g_timeout_add(100, [](gpointer userData) {
+                    connectToInspectorServer(static_cast<GMainLoop*>(userData));
+                    return G_SOURCE_REMOVE;
+                }, userData);
+                return;
+            }
 
-                g_printerr("Failed to connect to inspector server");
-                g_assert_not_reached();
-            }
-            gServerIsReady = true;
-            g_main_loop_quit(mainLoop);
+            g_printerr("Failed to connect to inspector server");
+            g_assert_not_reached();
+        }
+        gServerIsReady = true;
+        g_main_loop_quit(mainLoop);
     }, mainLoop);
 }
 
@@ -118,9 +118,13 @@
             size_t mainResourceDataSize = 0;
             const char* mainResourceData = this->mainResourceData(mainResourceDataSize);
             g_assert_nonnull(mainResourceData);
-            if (g_strrstr_len(mainResourceData, mainResourceDataSize, "No targets found"))
-                wait(0.1);
-            else if (g_strrstr_len(mainResourceData, mainResourceDataSize, "Inspectable targets"))
+            if (g_strrstr_len(mainResourceData, mainResourceDataSize, "No targets found")) {
+                webkit_web_view_reload(m_webView);
+                waitUntilLoadFinished();
+                continue;
+            }
+
+            if (g_strrstr_len(mainResourceData, mainResourceDataSize, "Inspectable targets"))
                 return true;
         }
 

Modified: trunk/Tools/TestWebKitAPI/glib/TestExpectations.json (264389 => 264390)


--- trunk/Tools/TestWebKitAPI/glib/TestExpectations.json	2020-07-15 08:00:13 UTC (rev 264389)
+++ trunk/Tools/TestWebKitAPI/glib/TestExpectations.json	2020-07-15 08:52:32 UTC (rev 264390)
@@ -86,12 +86,7 @@
         }
     },
     "TestInspectorServer": {
-        "expected": {"all": {"slow": true}},
-        "subtests": {
-            "/webkit/WebKitWebInspectorServer/test-page-list": {
-                "expected": {"all": {"status": ["FAIL", "PASS"], "bug": "webkit.org/b/188115"}}
-            }
-        }
+        "expected": {"all": {"slow": true}}
     },
     "TestWebKitFaviconDatabase": {
         "subtests": {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to