haikuwebkit/LayoutTests/media/video-seek-double-expected.txt

14 lines
252 B
Plaintext
Raw Permalink Normal View History

HTMLMediaElement seek algorithm should allow cancelling previous seeks. https://bugs.webkit.org/show_bug.cgi?id=134116 Reviewed by Eric Carlson. Source/WebCore: Test: media/video-seek-double.html Fulfill the requirement of the §4.7.14.9 seeking algorithm to do steps 5+ asynchronously and cancel previous instances of the algorithm. For the html/ parts of the algorithm, implement this by adding a seek timer, which when fired will issue steps 5-12. MediaPlayerPrivateAVFoundation will already coalesce multiple seek operations, so nothing additional needs be done there. However, MediaPlayerPrivateMediaSourceAVFObjC needs to implement the same pending seek logic in case additional seeks were issued after the html/ algorithm reached step 12. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize the new m_seekTimer. (WebCore::HTMLMediaElement::parseAttribute): Clear the seek timer. (WebCore::HTMLMediaElement::seekInternal): Differentiate between DOM seeks and internal seeks. (WebCore::HTMLMediaElement::seekWithTolerance:) Split into the seekTimerFired() method. (WebCore::HTMLMediaElement::seekTimerFired:) Added, split from seekWithTolerance(). * html/HTMLMediaElement.h: * html/MediaController.cpp: (MediaController::bringElementUpToSpeed): Call seekInternal(). (WebCore::HTMLMediaElement::PendingSeek::PendingSeek): Added convenience struct for storing seek requests. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::PendingSeek::PendingSeek): Ditto. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): Modify the time jumped handler to not clear the m_seeking flag if another seek request is pending. (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal): LayoutTests: * media/video-seek-double-expected.txt: Added. * media/video-seek-double.html: Added. Canonical link: https://commits.webkit.org/152194@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170336 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-24 00:08:25 +00:00
Test that seeking twice in the same run loop will cancel the first seek.
EVENT(canplaythrough)
RUN(video.currentTime = 2)
RUN(video.currentTime = 0.5)
EVENT(seeked)
EXPECTED (video.currentTime == '0.5') OK
RUN(video.play())
EVENT(play)
END OF TEST