Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 50eeda809aa991027d04d2d93738622c8bf90464
      
https://github.com/WebKit/WebKit/commit/50eeda809aa991027d04d2d93738622c8bf90464
  Author: Jer Noble <[email protected]>
  Date:   2025-05-23 (Fri, 23 May 2025)

  Changed paths:
    M Source/WebCore/CMakeLists.txt
    M Source/WebCore/Headers.cmake
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/dom/CustomEvent.h
    M Source/WebCore/dom/EventTarget.h
    M Source/WebCore/dom/EventTarget.idl
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLMediaElement.h
    A Source/WebCore/platform/MessageClientForTesting.h
    A Source/WebCore/platform/MessageForTesting.h
    A Source/WebCore/platform/MessageTargetForTesting.h
    M Source/WebCore/platform/graphics/MediaPlayer.cpp
    M Source/WebCore/platform/graphics/MediaPlayer.h
    M Source/WebCore/platform/graphics/MediaPlayerPrivate.h
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
    A Source/WebCore/testing/EventTargetForTesting.cpp
    A Source/WebCore/testing/EventTargetForTesting.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h
    M Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp
    M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h
    M Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebKitCocoa/SpatialAudioExperience.mm
    A 
Tools/TestWebKitAPI/Tests/WebKitCocoa/spatial-audio-experience-with-audio.html
    A 
Tools/TestWebKitAPI/Tests/WebKitCocoa/spatial-audio-experience-with-video.html

  Log Message:
  -----------
  [Cocoa] Add tests to validate the behavior of SpatialAudioExperience
https://bugs.webkit.org/show_bug.cgi?id=292195
<rdar://problem/150212519>

Reviewed by Andy Estes.

After adopting -setIntendedSpatialAudioExperience:, make the behavior testable
by adding a facility to pass messages up from the GPU process to the Internals
object. This facility can be re-used for other messages and other objects:

- MessageClientForTesting: An abstract interface which allows introspected 
objects
  to pass generic messages to clients for testing purposes.
- MessageForTesting: A simple message object containing a type and data string.
- EventTargetForTesting: A concrete EventTarget instantiated by Internals
- CustomEvent: A concrete Event subclass which can be initialized with a 
payload.

These classes are used by HTMLMediaElement, MediaPlayer, MediaPlayerInterface,
MediaPlayerPrivateRemote and RemoteMediaPlayer to provide a channel between
concrete MediaPlayerInterface classes like MediaPlayerPrivateAVFoundationObjC
and MediaPlayerPrivateMediaSourceAVFObjC, and the Internals object in the
WebContent process.

And this in turn enables tests like SpatialAudioExperience.NoWindow,
SpatialAudioExperience.WindowWithWindowScene and 
SpatialAudioExperience.AudioOnly.

* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/dom/EventInterfaces.in:
* Source/WebCore/dom/EventTargetFactory.in:
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::addMessageClientForTesting):
(WebCore::HTMLMediaElement::removeMessageClientForTesting):
* Source/WebCore/html/HTMLMediaElement.h:
* Source/WebCore/platform/MessageClientForTesting.h: Added.
(WebCore::AggregateMessageClientForTesting::create):
(WebCore::AggregateMessageClientForTesting::addClient):
(WebCore::AggregateMessageClientForTesting::removeClient):
(WebCore::AggregateMessageClientForTesting::isEmpty const):
* Source/WebCore/platform/MessageForTesting.h: Added.
* Source/WebCore/platform/MessageTargetForTesting.h: Added.
* Source/WebCore/platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::loadWithNextMediaEngine):
(WebCore::MediaPlayer::setMessageClientForTesting):
(WebCore::MediaPlayer::protectedMessageClientForTesting const):
* Source/WebCore/platform/graphics/MediaPlayer.h:
* Source/WebCore/platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setMessageClientForTesting):
* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateSpatialTrackingLabel):
* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateSpatialTrackingLabel):
* Source/WebCore/testing/EventForTesting.h: Added.
(WebCore::EventForTesting::create):
(WebCore::EventForTesting::data const):
(WebCore::EventForTesting::EventForTesting):
* Source/WebCore/testing/EventForTesting.idl: Added.
* Source/WebCore/testing/EventTargetForTesting.cpp: Added.
(WebCore::EventTargetForTesting::create):
(WebCore::EventTargetForTesting::~EventTargetForTesting):
(WebCore::EventTargetForTesting::EventTargetForTesting):
(WebCore::EventTargetForTesting::sendInternalMessage):
* Source/WebCore/testing/EventTargetForTesting.h: Added.
* Source/WebCore/testing/EventTargetForTesting.idl: Added.
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::addInternalEventTarget):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:
(WebKit::RemoteMediaPlayerProxy::setHasMessageClientForTesting):
(WebKit::RemoteMediaPlayerProxy::sendInternalMessage):
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.h:
* Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.messages.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebKitSwift/LinearMediaKit/LinearMediaPlayer.swift:
(WKSLinearMediaPlayer.isImmersiveVideo):
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:
(WebKit::MediaPlayerPrivateRemote::setMessageClientForTesting):
(WebKit::MediaPlayerPrivateRemote::sendInternalMessage):
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.h:
* Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.messages.in:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* 
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/xcshareddata/xcschemes/TestWebKitAPI.xcscheme:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SpatialAudioExperience.mm: Added.
(-[SpatialAudioExperienceMessageHandler 
userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::autoplayingInternalsConfiguration):
(TestWebKitAPI::TEST(SpatialAudioExperience, NoWindow)):
(TestWebKitAPI::TEST(SpatialAudioExperience, WindowWithWindowScene)):
(TestWebKitAPI::TEST(SpatialAudioExperience, AudioOnly)):
* 
Tools/TestWebKitAPI/Tests/WebKitCocoa/spatial-audio-experience-with-audio.html: 
Added.
* 
Tools/TestWebKitAPI/Tests/WebKitCocoa/spatial-audio-experience-with-video.html: 
Added.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to