Changeset 187588 in webkit
- Timestamp:
- Jul 30, 2015 10:02:13 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r187587 r187588 1 2015-07-29 Matt Rajca <mrajca@apple.com> 2 3 Media Session: add infrastructure for testing media control events 4 https://bugs.webkit.org/show_bug.cgi?id=147412 5 6 Reviewed by Eric Carlson. 7 8 * Modules/mediasession/MediaSessionManager.h: 9 * testing/Internals.cpp: 10 (WebCore::Internals::sendMediaControlEvent): Let tests simulate media control events. 11 * testing/Internals.h: 12 * testing/Internals.idl: 13 1 14 2015-07-30 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Source/WebCore/Modules/mediasession/MediaSessionManager.h
r187004 r187588 42 42 WEBCORE_EXPORT static MediaSessionManager& singleton(); 43 43 44 void togglePlayback();45 void skipToNextTrack();46 void skipToPreviousTrack();44 WEBCORE_EXPORT void togglePlayback(); 45 WEBCORE_EXPORT void skipToNextTrack(); 46 WEBCORE_EXPORT void skipToPreviousTrack(); 47 47 48 48 WEBCORE_EXPORT void didReceiveStartOfInterruptionNotification(MediaSessionInterruptingCategory) override; -
trunk/Source/WebCore/testing/Internals.cpp
r187377 r187588 2822 2822 return element->playerVolume(); 2823 2823 } 2824 2825 void Internals::sendMediaControlEvent(const String& event) 2826 { 2827 if (event == "play-pause") 2828 MediaSessionManager::singleton().togglePlayback(); 2829 else if (event == "next-track") 2830 MediaSessionManager::singleton().skipToNextTrack(); 2831 else if (event == "previous-track") 2832 MediaSessionManager::singleton().skipToPreviousTrack(); 2833 else 2834 ASSERT_NOT_REACHED(); 2835 } 2824 2836 #endif // ENABLE(MEDIA_SESSION) 2825 2837 -
trunk/Source/WebCore/testing/Internals.h
r187377 r187588 401 401 String mediaSessionCurrentState(MediaSession*) const; 402 402 double mediaElementPlayerVolume(HTMLMediaElement*) const; 403 void sendMediaControlEvent(const String&); 403 404 #endif 404 405 -
trunk/Source/WebCore/testing/Internals.idl
r187377 r187588 52 52 }; 53 53 54 enum MediaControlEvent { 55 "play-pause", 56 "next-track", 57 "previous-track" 58 }; 59 54 60 [ 55 61 NoInterfaceObject, … … 364 370 [Conditional=MEDIA_SESSION] DOMString mediaSessionCurrentState(MediaSession session); 365 371 [Conditional=MEDIA_SESSION] double mediaElementPlayerVolume(HTMLMediaElement element); 372 [Conditional=MEDIA_SESSION] void sendMediaControlEvent(MediaControlEvent event); 366 373 [Conditional=VIDEO] void applicationWillEnterForeground(); 367 374 [Conditional=VIDEO] void applicationWillEnterBackground();
Note: See TracChangeset
for help on using the changeset viewer.