Title: [245618] trunk/Tools
Revision
245618
Author
[email protected]
Date
2019-05-22 03:41:11 -0700 (Wed, 22 May 2019)

Log Message

Unreviewed. Fix WPE unit tests after r245565

Backend creation is failing when the a11y bus is not running because atk produces warning messages. We should
not make warnings fatal during backend creation.

* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
(testAutomationSessionRequestSession):
* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewGeolocationPermissionRequests):
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::createWebViewBackend):
(Test::addLogFatalFlag):
(Test::removeLogFatalFlag):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (245617 => 245618)


--- trunk/Tools/ChangeLog	2019-05-22 08:37:30 UTC (rev 245617)
+++ trunk/Tools/ChangeLog	2019-05-22 10:41:11 UTC (rev 245618)
@@ -1,3 +1,19 @@
+2019-05-22  Carlos Garcia Campos  <[email protected]>
+
+        Unreviewed. Fix WPE unit tests after r245565
+
+        Backend creation is failing when the a11y bus is not running because atk produces warning messages. We should
+        not make warnings fatal during backend creation.
+
+        * TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
+        (testAutomationSessionRequestSession):
+        * TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
+        (testWebViewGeolocationPermissionRequests):
+        * TestWebKitAPI/glib/WebKitGLib/TestMain.h:
+        (Test::createWebViewBackend):
+        (Test::addLogFatalFlag):
+        (Test::removeLogFatalFlag):
+
 2019-05-21  Aakash Jain  <[email protected]>
 
         [ews-build] Use custom templates for Buildbot (follow-up fix)

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp (245617 => 245618)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp	2019-05-22 08:37:30 UTC (rev 245617)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp	2019-05-22 10:41:11 UTC (rev 245618)
@@ -286,9 +286,9 @@
 
     // There can't be more than one context with automation enabled
     GRefPtr<WebKitWebContext> otherContext = adoptGRef(webkit_web_context_new());
-    test->removeLogFatalFlag(G_LOG_LEVEL_WARNING);
+    Test::removeLogFatalFlag(G_LOG_LEVEL_WARNING);
     webkit_web_context_set_automation_allowed(otherContext.get(), TRUE);
-    test->addLogFatalFlag(G_LOG_LEVEL_WARNING);
+    Test::addLogFatalFlag(G_LOG_LEVEL_WARNING);
     g_assert_false(webkit_web_context_is_automation_allowed(otherContext.get()));
 
     session = test->requestSession(sessionID.utf8().data());

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp (245617 => 245618)


--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp	2019-05-22 08:37:30 UTC (rev 245617)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp	2019-05-22 10:41:11 UTC (rev 245618)
@@ -791,7 +791,7 @@
     // Some versions of geoclue give a runtime warning because it tries
     // to register the error quark twice. See https://bugs.webkit.org/show_bug.cgi?id=89858.
     // Make warnings non-fatal for this test to make it pass.
-    test->removeLogFatalFlag(G_LOG_LEVEL_WARNING);
+    Test::removeLogFatalFlag(G_LOG_LEVEL_WARNING);
 #if PLATFORM(GTK)
     test->showInWindowAndWaitUntilMapped();
 #endif
@@ -828,7 +828,7 @@
     test->loadHtml(geolocationRequestHTML, "https://foo.com/bar");
     result = test->waitUntilPermissionResultMessageReceived();
     g_assert_cmpstr(result, !=, "1");
-    test->addLogFatalFlag(G_LOG_LEVEL_WARNING);
+    Test::addLogFatalFlag(G_LOG_LEVEL_WARNING);
 }
 
 #if ENABLE(MEDIA_STREAM)

Modified: trunk/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h (245617 => 245618)


--- trunk/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h	2019-05-22 08:37:30 UTC (rev 245617)
+++ trunk/Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h	2019-05-22 10:41:11 UTC (rev 245618)
@@ -155,7 +155,10 @@
 #if PLATFORM(WPE)
     static WebKitWebViewBackend* createWebViewBackend()
     {
+        // Don't make warnings fatal when creating the backend, since atk produces warnings when a11y bus is not running.
+        removeLogFatalFlag(G_LOG_LEVEL_WARNING);
         auto* headlessBackend = new WPEToolingBackends::HeadlessViewBackend(800, 600);
+        addLogFatalFlag(G_LOG_LEVEL_WARNING);
         // Make the view initially hidden for consistency with GTK+ tests.
         wpe_view_backend_remove_activity_state(headlessBackend->backend(), wpe_view_activity_state_visible | wpe_view_activity_state_focused);
         return webkit_web_view_backend_new(headlessBackend->backend(), [](gpointer userData) {
@@ -241,7 +244,7 @@
         RELEASE_ASSERT_NOT_REACHED();
     }
 
-    void addLogFatalFlag(unsigned flag)
+    static void addLogFatalFlag(unsigned flag)
     {
         unsigned fatalMask = g_log_set_always_fatal(static_cast<GLogLevelFlags>(G_LOG_FATAL_MASK));
         fatalMask |= flag;
@@ -248,7 +251,7 @@
         g_log_set_always_fatal(static_cast<GLogLevelFlags>(fatalMask));
     }
 
-    void removeLogFatalFlag(unsigned flag)
+    static void removeLogFatalFlag(unsigned flag)
     {
         unsigned fatalMask = g_log_set_always_fatal(static_cast<GLogLevelFlags>(G_LOG_FATAL_MASK));
         fatalMask &= ~flag;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to