Skip to content

Commit

Permalink
Fix addSourceBuffer(null) test case expectation (web-platform-tests#3653
Browse files Browse the repository at this point in the history
)

A null value passed to a non-nullable method DOMString argument is
converted to a DOMString "null". Therefore, it is not an empty string,
and the addSourceBuffer() implementation should instead throw a
NotSupportedException per the spec:

"If type contains a MIME type that is not supported or contains a MIME
type that is not supported with the types specified for the other
SourceBuffer objects in sourceBuffers, then throw a NotSupportedError
exception and abort these steps."
  • Loading branch information
wolenetz authored and plehegar committed Sep 7, 2016
1 parent 7731d4e commit c504a87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion media-source/mediasource-addsourcebuffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

mediasource_test(function(test, mediaElement, mediaSource)
{
assert_throws(new TypeError(),
assert_throws("NotSupportedError",
function() { mediaSource.addSourceBuffer(null); },
"addSourceBuffer() threw an exception when passed null.");
test.done();
Expand Down

0 comments on commit c504a87

Please sign in to comment.