Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2f1773be4fadac12c7ffbf72d85f1becae0e7558
      
https://github.com/WebKit/WebKit/commit/2f1773be4fadac12c7ffbf72d85f1becae0e7558
  Author: Eric Carlson <[email protected]>
  Date:   2026-01-27 (Tue, 27 Jan 2026)

  Changed paths:
    M LayoutTests/fast/mediastream/stream-switch.html
    M LayoutTests/media/utilities.js
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/platform/audio/MediaSessionManagerInterface.cpp
    M Source/WebCore/platform/audio/MediaSessionManagerInterface.h
    M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h
    M Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm
    A Tools/TestWebKitAPI/Tests/WebKitCocoa/small-video-test-now-playing.html
    A Tools/TestWebKitAPI/Tests/WebKitCocoa/small-video-with-silent-audio.mp4

  Log Message:
  -----------
  NEW TEST(305364@main) [macOS] 
TestWebKitAPI.NowPlayingControlsTests.NowPlayingUpdatesThrottled is flaky 
timeout and failure
https://bugs.webkit.org/show_bug.cgi?id=305493
rdar://168157711

Reviewed by Jer Noble.

Rewrite HTML used in the test to make state in the API test more deterministic. 
Drive-by fix:
NowPlaying isn't updated on some HTMLMediaElement state changes, for example 
when playback
is started for the first time, so call session->clientCharacteristicsChanged 
from
HTMLMediaElement::schedulePlaybackControlsManagerUpdate so we evaluate whether 
or not
NowPlaying should be updated on more state changes.

Tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm
       Tools/TestWebKitAPI/Tests/WebKitCocoa/small-video-test-now-playing.html
       Tools/TestWebKitAPI/Tests/WebKitCocoa/small-video-with-silent-audio.mp4

* LayoutTests/fast/mediastream/stream-switch.html: Add explicit timeout waiting 
for rVFC
* LayoutTests/media/utilities.js:
(waitForVideoFrameWithTimeout):

* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::schedulePlaybackControlsManagerUpdate): Call 
session->clientCharacteristicsChanged

* Source/WebCore/platform/audio/MediaSessionManagerInterface.cpp:
(WebCore::MediaSessionManagerInterface::updateNowPlayingInfo):
(WebCore::MediaSessionManagerInterface::setNowPlayingUpdateInterval):
(WebCore::MediaSessionManagerInterface::nowPlayingUpdateInterval):
* Source/WebCore/platform/audio/MediaSessionManagerInterface.h: Define 
nowPlayingUpdateInterval
so it can be checked from the API test.
* Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h:
* Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::updateActiveNowPlayingSession): Call 
adjustNowPlayingUpdateInterval
so the update interval can be adjusted for the session duration if necessary.
(WebCore::MediaSessionManagerCocoa::adjustNowPlayingUpdateInterval): Don't let 
the update
interval be longer than session.duration / 4.
(WebCore::MediaSessionManagerCocoa::setNowPlayingUpdateInterval): Call 
adjustNowPlayingUpdateInterval.
(WebCore::MediaSessionManagerCocoa::nowPlayingUpdateInterval):
(WebCore::MediaSessionManagerCocoa::updateNowPlayingInfo):

* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::nowPlayingUpdateInterval const):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm:
(TestWebKitAPI::TEST(NowPlayingControlsTests, 
DISABLED_NowPlayingUpdatesThrottled)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/small-video-test-now-playing.html: 
Added.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/small-video-with-silent-audio.mp4: 
Added.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to