Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c01deccd0d0d7bcd8f7c4b2060bd3d8044bb20bb
      
https://github.com/WebKit/WebKit/commit/c01deccd0d0d7bcd8f7c4b2060bd3d8044bb20bb
  Author: Jer Noble <[email protected]>
  Date:   2026-03-02 (Mon, 02 Mar 2026)

  Changed paths:
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/platform/graphics/MediaPlayer.cpp
    M Source/WebCore/platform/graphics/MediaPlayer.h
    M 
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A 
Tools/TestWebKitAPI/Tests/WebCore/cocoa/MediaPlayerPrivateAVFoundationObjCTests.mm

  Log Message:
  -----------
  [Cocoa] Add IsAudible test for 308503@main
rdar://171583006
https://bugs.webkit.org/show_bug.cgi?id=309033

Reviewed by Jean-Yves Avenard.

Add a test for the behavior fixed by 308503@main, where depending upon the 
order in which
setMuted() and setVolume() were called, the MediaPlayer PrivateAVFoundationObjC 
object would not
update whether it was audible.

To do so, give default implementations to (nearly) all the methods in 
MediaPlayerClient, which makes
writing unit tests for MediaPlayer very simple. Additionally, add a type traits 
macro to
MediaPlayerPrivateAVFoundationObjC to enable the test code to safely cast to 
that type from
MediaPlayerPrivateInterface.

Tests: Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
       
Tools/TestWebKitAPI/Tests/WebCore/cocoa/MediaPlayerPrivateAVFoundationObjCTests.mm

* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
* Source/WebCore/platform/graphics/MediaPlayer.h:
* 
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
(isType):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* 
Tools/TestWebKitAPI/Tests/WebCore/cocoa/MediaPlayerPrivateAVFoundationObjCTests.mm:
 Added.
(TestWebKitAPI::MediaPlayerPrivateAVFoundationObjCTest::mediaPlayerClientIdentifier
 const):
(TestWebKitAPI::MediaPlayerPrivateAVFoundationObjCTest::playerPrivate const):
(TestWebKitAPI::MediaPlayerPrivateAVFoundationObjCTest::videoWithAudioURL 
const):
(TestWebKitAPI::MediaPlayerPrivateAVFoundationObjCTest::videoWithoutAudioURL 
const):
(TestWebKitAPI::MediaPlayerPrivateAVFoundationObjCTest::waitForReadyStateGreaterThan):
(TestWebKitAPI::TEST_F(MediaPlayerPrivateAVFoundationObjCTest, Basic)):
(TestWebKitAPI::TEST_F(MediaPlayerPrivateAVFoundationObjCTest, IsAudible)):
(TestWebKitAPI::TEST_F(MediaPlayerPrivateAVFoundationObjCTest, 
IsAudibleSilentVideo)):

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



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

Reply via email to