Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

media-source/SourceBuffer-abort-updating.html is incorrect. #28859

Open
jyavenard opened this issue May 6, 2021 · 1 comment
Open

media-source/SourceBuffer-abort-updating.html is incorrect. #28859

jyavenard opened this issue May 6, 2021 · 1 comment
Assignees

Comments

@jyavenard
Copy link
Contributor

The test is invalid in that it makes some assumption about non deterministic behaviour.

The current expected flow of the test is as follow:
Append data to a source buffer; this will fire the “update” event.
The update event is fired, the event listener calls sourcebuffer.abort() which will fire the event “abort” followed “updateend” (https://w3c.github.io/media-source/#dom-sourcebuffer-abort steps 4.3 and 4.4)

An updateend event listener is set that will call MediaSource.endOfStream()


Now the issue at hand is that there’s no guarantee that when the “update” event listener runs the updateend event hasn’t already been queued from the original appendBuffer operation (the processing of the source buffer is asynchronous as per https://w3c.github.io/media-source/#dom-sourcebuffer-appendbuffer step 5)

If that happens two updateend events will be fired.
The first updateend listener will call MediaSource.endOfStream() which set the MediaSource readyState as “ended”.

If a 2nd updateend is fired then MediaSource.endOfStream() will be run again.

Per spec:
https://w3c.github.io/media-source/#dom-mediasource-endofstream
“If the readyState attribute is not in the "open" state then throw an InvalidStateError exception and abort these steps.”

If this happens the test will fail with "The object is in an invalid state."

This test is disabled in Mozilla's test suite: https://bugzilla.mozilla.org/show_bug.cgi?id=1288343#c10
As well as in WebKit for those reasons.

@wolenetz
Copy link
Member

wolenetz commented May 7, 2021

Thank you for reporting this test issue. Your concern appears valid and I'll look into a fix for this.

@wolenetz wolenetz self-assigned this May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants