haikuwebkit/LayoutTests/media/video-paused-0-rate.html

45 lines
1.3 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html>
<head>
<script src=media-file.js></script>
<script src=video-test.js></script>
<script>
var timeUpdateWasCalled = false;
[Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed https://bugs.webkit.org/show_bug.cgi?id=195454 Reviewed by Jer Noble. Source/WebCore: This change fixes YouTube 2019 MSE Conformance Tests "26. SFRPausedAccuracy" and "27. HFRPausedAccuracy". The first timeUpdate event after play() is omitted, because currentTime doesn't actually change in that scenario. Tests 26 and 27 measure the time drift (real time vs. media time) on playback and start counting since the first timeUpdate event. In WebKit, that event happens at play(), before the pipeline has completed the transition to playing. Therefore, the real time inherits this startup delay and the test thinks that the player has drifted. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::playInternal): Don't emit a timeUpdated event unless currentTime has changed. LayoutTests: This patch removes expectations for the first timeUpdate event after play(), because currentTime doesn't actually change in that scenario and the spec[1] states that a timeupdate event is fired if "The current playback position changed as part of normal playback or in an especially interesting way, for example discontinuously." [1] https://www.w3.org/TR/html52/semantics-embedded-content.html#eventdef-media-timeupdate * media/video-paused-0-rate.html: Don't require the timeUpdate event when currentTime=0 to pass the test. * media/video-play-pause-events-expected.txt: Ditto, and changed test description. * media/video-play-pause-events.html: Changed test description to reflect the new behaviour. * media/video-play-pause-exception-expected.txt: Don't require the timeUpdate event. Canonical link: https://commits.webkit.org/209919@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-12 11:09:45 +00:00
var startTime = NaN;
function start()
{
findMediaElement();
video.src = findMediaFile("video", "content/test");
waitForEventAndFail('ended');
video.addEventListener('timeupdate', timeupdate);
waitForEventOnce('canplaythrough', canPlayThrough);
}
function canPlayThrough()
{
video.playbackRate = 0;
[Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed https://bugs.webkit.org/show_bug.cgi?id=195454 Reviewed by Jer Noble. Source/WebCore: This change fixes YouTube 2019 MSE Conformance Tests "26. SFRPausedAccuracy" and "27. HFRPausedAccuracy". The first timeUpdate event after play() is omitted, because currentTime doesn't actually change in that scenario. Tests 26 and 27 measure the time drift (real time vs. media time) on playback and start counting since the first timeUpdate event. In WebKit, that event happens at play(), before the pipeline has completed the transition to playing. Therefore, the real time inherits this startup delay and the test thinks that the player has drifted. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::playInternal): Don't emit a timeUpdated event unless currentTime has changed. LayoutTests: This patch removes expectations for the first timeUpdate event after play(), because currentTime doesn't actually change in that scenario and the spec[1] states that a timeupdate event is fired if "The current playback position changed as part of normal playback or in an especially interesting way, for example discontinuously." [1] https://www.w3.org/TR/html52/semantics-embedded-content.html#eventdef-media-timeupdate * media/video-paused-0-rate.html: Don't require the timeUpdate event when currentTime=0 to pass the test. * media/video-play-pause-events-expected.txt: Ditto, and changed test description. * media/video-play-pause-events.html: Changed test description to reflect the new behaviour. * media/video-play-pause-exception-expected.txt: Don't require the timeUpdate event. Canonical link: https://commits.webkit.org/209919@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-12 11:09:45 +00:00
startTime = video.currentTime;
setTimeout("checkplayback()", 250);
video.play();
}
function timeupdate()
[Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed https://bugs.webkit.org/show_bug.cgi?id=195454 Reviewed by Jer Noble. Source/WebCore: This change fixes YouTube 2019 MSE Conformance Tests "26. SFRPausedAccuracy" and "27. HFRPausedAccuracy". The first timeUpdate event after play() is omitted, because currentTime doesn't actually change in that scenario. Tests 26 and 27 measure the time drift (real time vs. media time) on playback and start counting since the first timeUpdate event. In WebKit, that event happens at play(), before the pipeline has completed the transition to playing. Therefore, the real time inherits this startup delay and the test thinks that the player has drifted. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::playInternal): Don't emit a timeUpdated event unless currentTime has changed. LayoutTests: This patch removes expectations for the first timeUpdate event after play(), because currentTime doesn't actually change in that scenario and the spec[1] states that a timeupdate event is fired if "The current playback position changed as part of normal playback or in an especially interesting way, for example discontinuously." [1] https://www.w3.org/TR/html52/semantics-embedded-content.html#eventdef-media-timeupdate * media/video-paused-0-rate.html: Don't require the timeUpdate event when currentTime=0 to pass the test. * media/video-play-pause-events-expected.txt: Ditto, and changed test description. * media/video-play-pause-events.html: Changed test description to reflect the new behaviour. * media/video-play-pause-exception-expected.txt: Don't require the timeUpdate event. Canonical link: https://commits.webkit.org/209919@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-12 11:09:45 +00:00
{
if (video.currentTime != startTime)
failTest("Time was updated, but should not change.");
}
function checkplayback()
{
testExpected('video.currentTime', 0);
testExpected('video.paused', false);
[Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed https://bugs.webkit.org/show_bug.cgi?id=195454 Reviewed by Jer Noble. Source/WebCore: This change fixes YouTube 2019 MSE Conformance Tests "26. SFRPausedAccuracy" and "27. HFRPausedAccuracy". The first timeUpdate event after play() is omitted, because currentTime doesn't actually change in that scenario. Tests 26 and 27 measure the time drift (real time vs. media time) on playback and start counting since the first timeUpdate event. In WebKit, that event happens at play(), before the pipeline has completed the transition to playing. Therefore, the real time inherits this startup delay and the test thinks that the player has drifted. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::playInternal): Don't emit a timeUpdated event unless currentTime has changed. LayoutTests: This patch removes expectations for the first timeUpdate event after play(), because currentTime doesn't actually change in that scenario and the spec[1] states that a timeupdate event is fired if "The current playback position changed as part of normal playback or in an especially interesting way, for example discontinuously." [1] https://www.w3.org/TR/html52/semantics-embedded-content.html#eventdef-media-timeupdate * media/video-paused-0-rate.html: Don't require the timeUpdate event when currentTime=0 to pass the test. * media/video-play-pause-events-expected.txt: Ditto, and changed test description. * media/video-play-pause-events.html: Changed test description to reflect the new behaviour. * media/video-play-pause-exception-expected.txt: Don't require the timeUpdate event. Canonical link: https://commits.webkit.org/209919@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242791 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-12 11:09:45 +00:00
endTest();
}
</script>
</head>
<body onload="start()">
<video></video>
<p>Test that setting '0' playbackRate works correctly.</p>
</body>
</html>