Skip to content

Commit

Permalink
REGRESSION(262173@main): [ macOS WK2 ] media/media-source/media-sourc…
Browse files Browse the repository at this point in the history
…e-duplicate-seeked.html is a flaky failure

https://bugs.webkit.org/show_bug.cgi?id=259699
rdar://113221970

Reviewed by Jer Noble.

The test was non-deterministic/invalid.

It adds 1s of video element (using the MockSourceBuffer) and set the duration to 1s.
It then seeks `currentTime = 1` which is the end of the video and then
calls play() again once the `seeked` event has fired.

However, per spec, if the playback has reached the end of the video and you call `play()`

https://html.spec.whatwg.org/multipage/media.html#internal-play-steps
"If the playback has ended and the direction of playback is forwards, seek to the earliest possible position of the media resource."

so we seek again.

The flow of the test was as follow:
1- Load 1s of data
2- set duration to 1s
3- call endOfStream
3- seek to 1s
4- seek completes -> `seeked` event is fired.
5- `ended` event is fired
5- call play(), we are at the end of the element, we seek to the start -> `seeked` event is fired,
6- playback continue and now reaches the end -> `ended` event is fired.

So we have the `ended` event fired twice, but the test expect `ended` to
be fired before `seeked` which is only true if the listener of the first `ended` event hasn't run.

Not seeking to the end of the video at the start of the test, but slightly
before would keep the aim of the test, but not caused `ended` event to be
fired twice as we will only reach the end if the media is playing.

* LayoutTests/media/media-source/media-source-duplicate-seeked-expected.txt:
* LayoutTests/media/media-source/media-source-duplicate-seeked.html:
* LayoutTests/platform/mac-gpup/TestExpectations:
* LayoutTests/platform/mac-wk2/TestExpectations:

Canonical link: https://commits.webkit.org/267024@main
  • Loading branch information
jyavenard committed Aug 18, 2023
1 parent e225f38 commit 95c4d7e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN(sourceBuffer.appendBuffer(samples))
EVENT(updateend)
RUN(source.duration = 1)
RUN(source.endOfStream())
RUN(video.currentTime = 1)
RUN(video.currentTime = 0.9)
EVENT(seeked)
RUN(video.play())
EVENT(ended)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,18 @@
run('source.duration = 1');
run('source.endOfStream()');
waitForEventOnce('seeked', seeked);
run('video.currentTime = 1');
run('video.currentTime = 0.9');
}

function seeked() {
waitForEventAndFail('seeked');
waitForEventAndEnd('ended');
waitForEventOnce('ended', () => {
// Wait a bit to make sure no seeked event is fired again.
sleepFor(200).then(() => { endTest(); });
});
run('video.play()');
}

</script>
</head>
<body onload="runTest()">
Expand Down
2 changes: 0 additions & 2 deletions LayoutTests/platform/mac-gpup/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ webxr [ Skip ]

# rdar://112801240
[ Ventura x86_64 ] fast/events/wheel/redispatched-wheel-event.html [ Pass Failure ]

webkit.org/b/259699 media/media-source/media-source-duplicate-seeked.html [ Pass Failure ]
8 changes: 3 additions & 5 deletions LayoutTests/platform/mac-wk2/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -1784,10 +1784,10 @@ webkit.org/b/238749 imported/w3c/web-platform-tests/html/semantics/interactive-e

webkit.org/b/258325 [ Debug ] media/modern-media-controls/pip-support/pip-support-click.html [ Crash ]

# webkit.org/b/258328 Umbrella Bug: Batch mark expectations slowing down EWS (258328)
# webkit.org/b/258328 Umbrella Bug: Batch mark expectations slowing down EWS (258328)
[ Debug ] imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.crossOriginSource.sub.html [ Pass Failure ]
imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-035.html [ Pass ImageOnlyFailure ]
fast/forms/file/entries-api/image-no-transcode-open-panel.html [ Pass Crash ]
imported/w3c/web-platform-tests/css/css-sizing/aspect-ratio/replaced-element-035.html [ Pass ImageOnlyFailure ]
fast/forms/file/entries-api/image-no-transcode-open-panel.html [ Pass Crash ]
[ Debug Ventura arm64 ] http/tests/media/modern-media-controls/overflow-support/playback-speed-live-broadcast.html [ Pass Crash ]
[ Debug arm64 ] media/track/track-css-visible-stroke.html [ Pass Crash ]
[ Ventura Debug arm64 ] http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html [ Pass Crash ]
Expand Down Expand Up @@ -1831,8 +1831,6 @@ webkit.org/b/259496 [ x86_64 ] imported/w3c/web-platform-tests/webcodecs/tempora

webkit.org/b/259183 fast/attachment/mac/wide-attachment-image-controls-basic.html [ Pass Failure ]

webkit.org/b/259699 media/media-source/media-source-duplicate-seeked.html [ Pass Failure ]

webkit.org/b/259708 fast/mediastream/video-rotation-gpu-process-crash.html [ Pass Crash Failure Timeout ]

webkit.org/b/259712 media/media-source/media-source-paint-after-display-none.html [ Pass Crash Failure Timeout ]
Expand Down

0 comments on commit 95c4d7e

Please sign in to comment.