haikuwebkit/LayoutTests/media/remote-control-command-seek...

15 lines
289 B
Plaintext
Raw Permalink Normal View History

[Mac][iOS] Adopt MediaRemote "seek to playback position" https://bugs.webkit.org/show_bug.cgi?id=160405 <rdar://problem/27547583> Reviewed by Dean Jackson. Source/WebCore: Test: media/remote-control-command-seek.html * Modules/webaudio/AudioContext.h: Update for didReceiveRemoteControlCommand argument change. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Support SeekToPlaybackPositionCommand. Drive by fix, support Stop command. (WebCore::HTMLMediaElement::supportsSeeking): New. * html/HTMLMediaElement.h: * platform/RemoteCommandListener.h: (WebCore::RemoteCommandListenerClient::didReceiveRemoteControlCommand): Add command argument. (WebCore::RemoteCommandListenerClient::supportsSeeking): New. (WebCore::RemoteCommandListener::updateSupportedCommands): Ditto. (WebCore::RemoteCommandListener::client): Ditto. * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Add command argument. (WebCore::PlatformMediaSession::supportsSeeking): New, pass through to client. * platform/audio/PlatformMediaSession.h: * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::setCurrentSession): Tell remote command listener to update supported commands. (WebCore::PlatformMediaSessionManager::currentSession): Make const. (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand): Add command argument. (WebCore::PlatformMediaSessionManager::supportsSeeking): New, pass through to session. * platform/audio/PlatformMediaSessionManager.h: * platform/ios/RemoteCommandListenerIOS.h: (WebCore::RemoteCommandListenerIOS::createWeakPtr): * platform/ios/RemoteCommandListenerIOS.mm: (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS): Support changePlaybackPositionCommand. (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS): Remove seekToTime target. (WebCore::RemoteCommandListenerIOS::updateSupportedCommands): Update changePlaybackPositionCommand. * platform/mac/MediaRemoteSoftLink.cpp: * platform/mac/MediaRemoteSoftLink.h: * platform/mac/RemoteCommandListenerMac.h: * platform/mac/RemoteCommandListenerMac.mm: (WebCore::RemoteCommandListenerMac::updateSupportedCommands): New, split out of constructor. (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Split setup logic out into updateSupportedCommands. Support MRMediaRemoteCommandSeekToPlaybackPosition. Don't assert when receiving an unsupported command, it happens. Return error when a command isn't supported or fails. * testing/Internals.cpp: (WebCore::Internals::postRemoteControlCommand): Add command argument parameter. Support seektoplaybackposition. * testing/Internals.h: * testing/Internals.idl: LayoutTests: * media/remote-control-command-seek-expected.txt: Added. * media/remote-control-command-seek.html: Added. Canonical link: https://commits.webkit.org/178553@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-01 19:49:02 +00:00
Test that the "seekToPlaybackPosition" remote control command works.
* set video.src
EVENT(canplaythrough)
[Mac][iOS] Adopt MediaRemote "seek to playback position" https://bugs.webkit.org/show_bug.cgi?id=160405 <rdar://problem/27547583> Reviewed by Dean Jackson. Source/WebCore: Test: media/remote-control-command-seek.html * Modules/webaudio/AudioContext.h: Update for didReceiveRemoteControlCommand argument change. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Support SeekToPlaybackPositionCommand. Drive by fix, support Stop command. (WebCore::HTMLMediaElement::supportsSeeking): New. * html/HTMLMediaElement.h: * platform/RemoteCommandListener.h: (WebCore::RemoteCommandListenerClient::didReceiveRemoteControlCommand): Add command argument. (WebCore::RemoteCommandListenerClient::supportsSeeking): New. (WebCore::RemoteCommandListener::updateSupportedCommands): Ditto. (WebCore::RemoteCommandListener::client): Ditto. * platform/audio/PlatformMediaSession.cpp: (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Add command argument. (WebCore::PlatformMediaSession::supportsSeeking): New, pass through to client. * platform/audio/PlatformMediaSession.h: * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::setCurrentSession): Tell remote command listener to update supported commands. (WebCore::PlatformMediaSessionManager::currentSession): Make const. (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand): Add command argument. (WebCore::PlatformMediaSessionManager::supportsSeeking): New, pass through to session. * platform/audio/PlatformMediaSessionManager.h: * platform/ios/RemoteCommandListenerIOS.h: (WebCore::RemoteCommandListenerIOS::createWeakPtr): * platform/ios/RemoteCommandListenerIOS.mm: (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS): Support changePlaybackPositionCommand. (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS): Remove seekToTime target. (WebCore::RemoteCommandListenerIOS::updateSupportedCommands): Update changePlaybackPositionCommand. * platform/mac/MediaRemoteSoftLink.cpp: * platform/mac/MediaRemoteSoftLink.h: * platform/mac/RemoteCommandListenerMac.h: * platform/mac/RemoteCommandListenerMac.mm: (WebCore::RemoteCommandListenerMac::updateSupportedCommands): New, split out of constructor. (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Split setup logic out into updateSupportedCommands. Support MRMediaRemoteCommandSeekToPlaybackPosition. Don't assert when receiving an unsupported command, it happens. Return error when a command isn't supported or fails. * testing/Internals.cpp: (WebCore::Internals::postRemoteControlCommand): Add command argument parameter. Support seektoplaybackposition. * testing/Internals.h: * testing/Internals.idl: LayoutTests: * media/remote-control-command-seek-expected.txt: Added. * media/remote-control-command-seek.html: Added. Canonical link: https://commits.webkit.org/178553@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-01 19:49:02 +00:00
* Send a seek command.
RUN(internals.postRemoteControlCommand('seekToPlaybackPosition', 1.6))
EVENT(timeupdate)
EXPECTED (video.currentTime.toFixed(1) == '1.6') OK
END OF TEST