Title: [293648] trunk
Revision
293648
Author
[email protected]
Date
2022-04-30 09:50:14 -0700 (Sat, 30 Apr 2022)

Log Message

REGRESSION(r283437) a number of media tests fail/timeout on the test bots
https://bugs.webkit.org/show_bug.cgi?id=231811
<rdar://problem/84552871>

Patch by Philippe Normand <[email protected]> on 2022-04-30
Reviewed by Michael Catanzaro.

Disable DBus MPRIS notifications when running the tests, these leak to the host when running
on desktop and trigger timeouts on under-powered bots.

* platform/audio/glib/MediaSessionGLib.cpp:
(WebCore::MediaSessionGLib::create):
(WebCore::MediaSessionGLib::MediaSessionGLib):
(WebCore::MediaSessionGLib::emitPositionChanged):
(WebCore::MediaSessionGLib::updateNowPlaying):
(WebCore::MediaSessionGLib::playbackStatusChanged):
* platform/audio/glib/MediaSessionManagerGLib.h:
(WebCore::MediaSessionManagerGLib::setDBusNotificationsEnabled):
(WebCore::MediaSessionManagerGLib::areDBusNotificationsEnabled const):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):

LayoutTests:

* platform/glib/TestExpectations: Unflag tests now passing.

Canonical link: https://commits.webkit.org/250152@main

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (293647 => 293648)


--- trunk/LayoutTests/ChangeLog	2022-04-30 16:30:46 UTC (rev 293647)
+++ trunk/LayoutTests/ChangeLog	2022-04-30 16:50:14 UTC (rev 293648)
@@ -1,3 +1,13 @@
+2022-04-30  Philippe Normand  <[email protected]>
+
+        REGRESSION(r283437) a number of media tests fail/timeout on the test bots
+        https://bugs.webkit.org/show_bug.cgi?id=231811
+        <rdar://problem/84552871>
+
+        Reviewed by Michael Catanzaro.
+
+        * platform/glib/TestExpectations: Unflag tests now passing.
+
 2022-04-30  Alan Bujtas  <[email protected]>
 
         ASSERTION FAILED: *trailingRunIndex >= overflowingRunIndex in WebCore::Layout::InlineContentBreaker::tryBreakingNextOverflowingRuns

Modified: trunk/LayoutTests/platform/glib/TestExpectations (293647 => 293648)


--- trunk/LayoutTests/platform/glib/TestExpectations	2022-04-30 16:30:46 UTC (rev 293647)
+++ trunk/LayoutTests/platform/glib/TestExpectations	2022-04-30 16:50:14 UTC (rev 293648)
@@ -848,26 +848,6 @@
 
 webkit.org/b/230028 media/media-source/media-source-seek-twice.html [ Pass Timeout ]
 
-webkit.org/b/231811 media/audio-background-playback-playlist.html [ Failure ]
-webkit.org/b/231811 media/media-session/actionHandlerInternalMappings.html [ Failure ]
-webkit.org/b/231811 media/media-session/default-actionHandlers.html [ Failure ]
-webkit.org/b/231811 media/video-background-playback.html [ Failure ]
-webkit.org/b/231811 media/video-concurrent-playback.html [ Failure ]
-webkit.org/b/231811 media/video-interruption-with-resume-not-allowing-play.html [ Failure ]
-webkit.org/b/231811 media/video-multiple-concurrent-playback.html [ Failure ]
-webkit.org/b/231811 media/webaudio-background-playback.html [ Failure ]
-webkit.org/b/231811 media/media-session/callActionHandler.html [ Timeout ]
-webkit.org/b/231811 media/media-session/play-after-seek.html [ Timeout ]
-webkit.org/b/231811 media/remote-control-command-is-user-gesture.html [ Timeout ]
-webkit.org/b/231811 media/remote-control-command-scrubbing.html [ Timeout ]
-webkit.org/b/231811 media/remote-control-command-seek.html [ Timeout ]
-webkit.org/b/231811 media/video-inactive-playback.html [ Timeout ]
-webkit.org/b/231811 media/video-interruption-with-resume-allowing-play.html [ Timeout ]
-webkit.org/b/231811 media/video-isplayingtoautomotiveheadunit.html [ Timeout ]
-webkit.org/b/231811 media/video-system-sleep.html [ Timeout ]
-webkit.org/b/231811 webaudio/audiocontext-state-interrupted.html [ Timeout ]
-webkit.org/b/231811 webaudio/suspend-context-while-interrupted.html [ Timeout ]
-
 # rvfc related failures
 imported/w3c/web-platform-tests/video-rvfc [ Pass ]
 fast/mediastream/getUserMedia-rvfc.html [ Pass Failure ]

Modified: trunk/Source/WebCore/ChangeLog (293647 => 293648)


--- trunk/Source/WebCore/ChangeLog	2022-04-30 16:30:46 UTC (rev 293647)
+++ trunk/Source/WebCore/ChangeLog	2022-04-30 16:50:14 UTC (rev 293648)
@@ -1,3 +1,26 @@
+2022-04-30  Philippe Normand  <[email protected]>
+
+        REGRESSION(r283437) a number of media tests fail/timeout on the test bots
+        https://bugs.webkit.org/show_bug.cgi?id=231811
+        <rdar://problem/84552871>
+
+        Reviewed by Michael Catanzaro.
+
+        Disable DBus MPRIS notifications when running the tests, these leak to the host when running
+        on desktop and trigger timeouts on under-powered bots.
+
+        * platform/audio/glib/MediaSessionGLib.cpp:
+        (WebCore::MediaSessionGLib::create):
+        (WebCore::MediaSessionGLib::MediaSessionGLib):
+        (WebCore::MediaSessionGLib::emitPositionChanged):
+        (WebCore::MediaSessionGLib::updateNowPlaying):
+        (WebCore::MediaSessionGLib::playbackStatusChanged):
+        * platform/audio/glib/MediaSessionManagerGLib.h:
+        (WebCore::MediaSessionManagerGLib::setDBusNotificationsEnabled):
+        (WebCore::MediaSessionManagerGLib::areDBusNotificationsEnabled const):
+        * testing/Internals.cpp:
+        (WebCore::Internals::resetToConsistentState):
+
 2022-04-30  Alan Bujtas  <[email protected]>
 
         Only stretch the percent height <body> when it is the document element's child

Modified: trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp (293647 => 293648)


--- trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp	2022-04-30 16:30:46 UTC (rev 293647)
+++ trunk/Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp	2022-04-30 16:50:14 UTC (rev 293648)
@@ -174,6 +174,9 @@
 
 std::unique_ptr<MediaSessionGLib> MediaSessionGLib::create(MediaSessionManagerGLib& manager, MediaSessionIdentifier identifier)
 {
+    if (!manager.areDBusNotificationsEnabled())
+        return makeUnique<MediaSessionGLib>(manager, nullptr, identifier);
+
     GUniqueOutPtr<GError> error;
     GUniquePtr<char> address(g_dbus_address_get_for_bus_sync(G_BUS_TYPE_SESSION, nullptr, &error.outPtr()));
     if (error) {
@@ -197,6 +200,9 @@
     , m_manager(manager)
     , m_connection(WTFMove(connection))
 {
+    if (!m_connection)
+        return;
+
     const auto& mprisInterface = m_manager.mprisInterface();
     GUniqueOutPtr<GError> error;
     m_rootRegistrationId = g_dbus_connection_register_object(m_connection.get(), DBUS_MPRIS_OBJECT_PATH, mprisInterface->interfaces[0],
@@ -235,6 +241,9 @@
 
 void MediaSessionGLib::emitPositionChanged(double time)
 {
+    if (!m_connection)
+        return;
+
     GUniqueOutPtr<GError> error;
     int64_t position = time * 1000000;
     if (!g_dbus_connection_emit_signal(m_connection.get(), nullptr, DBUS_MPRIS_OBJECT_PATH, DBUS_MPRIS_PLAYER_INTERFACE, "Seeked", g_variant_new("(x)", position), &error.outPtr()))
@@ -243,6 +252,9 @@
 
 void MediaSessionGLib::updateNowPlaying(NowPlayingInfo& nowPlayingInfo)
 {
+    if (!m_connection)
+        return;
+
     GVariantBuilder propertiesBuilder;
     g_variant_builder_init(&propertiesBuilder, G_VARIANT_TYPE("a{sv}"));
     g_variant_builder_add(&propertiesBuilder, "{sv}", "Metadata", getMetadataAsGVariant(nowPlayingInfo));
@@ -315,6 +327,9 @@
 
 void MediaSessionGLib::playbackStatusChanged(PlatformMediaSession& platformSession)
 {
+    if (!m_connection)
+        return;
+
     GVariantBuilder builder;
     g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}"));
     g_variant_builder_add(&builder, "{sv}", "PlaybackStatus", getPlaybackStatusAsGVariant(&platformSession));

Modified: trunk/Source/WebCore/platform/audio/glib/MediaSessionManagerGLib.h (293647 => 293648)


--- trunk/Source/WebCore/platform/audio/glib/MediaSessionManagerGLib.h	2022-04-30 16:30:46 UTC (rev 293647)
+++ trunk/Source/WebCore/platform/audio/glib/MediaSessionManagerGLib.h	2022-04-30 16:50:14 UTC (rev 293648)
@@ -53,6 +53,9 @@
     const GRefPtr<GDBusNodeInfo>& mprisInterface() const { return m_mprisInterface; }
     PlatformMediaSession* nowPlayingEligibleSession();
 
+    void setDBusNotificationsEnabled(bool dbusNotificationsEnabled) { m_dbusNotificationsEnabled = dbusNotificationsEnabled; }
+    bool areDBusNotificationsEnabled() const { return m_dbusNotificationsEnabled; }
+
 protected:
     void scheduleSessionStatusUpdate() final;
     void updateNowPlayingInfo();
@@ -99,6 +102,8 @@
 
     const std::unique_ptr<NowPlayingManager> m_nowPlayingManager;
     HashMap<MediaSessionIdentifier, std::unique_ptr<MediaSessionGLib>> m_sessions;
+
+    bool m_dbusNotificationsEnabled { true };
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/testing/Internals.cpp (293647 => 293648)


--- trunk/Source/WebCore/testing/Internals.cpp	2022-04-30 16:30:46 UTC (rev 293647)
+++ trunk/Source/WebCore/testing/Internals.cpp	2022-04-30 16:50:14 UTC (rev 293648)
@@ -362,6 +362,10 @@
 #include "NavigatorMediaSession.h"
 #endif
 
+#if ENABLE(MEDIA_SESSION) && USE(GLIB)
+#include "MediaSessionManagerGLib.h"
+#endif
+
 #if ENABLE(IMAGE_ANALYSIS)
 #include "TextRecognitionResult.h"
 #endif
@@ -633,6 +637,11 @@
 #if PLATFORM(IOS)
     RenderThemeIOS::setContentSizeCategory(kCTFontContentSizeCategoryL);
 #endif
+
+#if ENABLE(MEDIA_SESSION) && USE(GLIB)
+    auto& sessionManager = reinterpret_cast<MediaSessionManagerGLib&>(PlatformMediaSessionManager::sharedManager());
+    sessionManager.setDBusNotificationsEnabled(false);
+#endif
 }
 
 Internals::Internals(Document& document)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to