Index: LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html |
diff --git a/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html b/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html |
index 523a005d269f2362fbc0ea4e5f2a4f40383649f4..fd9c403f06c4da702a06d34e435f8ec5c7d427b6 100644 |
--- a/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html |
+++ b/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html |
@@ -26,7 +26,15 @@ |
"addSourceBuffer() threw an exception when passed an empty string."); |
test.done(); |
}, "Test addSourceBuffer() with empty type"); |
- |
+ |
+ mediasource_test(function(test, mediaElement, mediaSource) |
+ { |
+ assert_throws("NotSupportedError", |
+ function() { mediaSource.addSourceBuffer(null); }, |
+ "addSourceBuffer() threw an exception when passed null."); |
+ test.done(); |
+ }, "Test addSourceBuffer() with null"); |
+ |
mediasource_test(function(test, mediaElement, mediaSource) |
{ |
assert_throws("NotSupportedError", |
@@ -47,7 +55,7 @@ |
assert_equals(mediaSource.activeSourceBuffers[0], sourceBuffer, "SourceBuffer is in mediaSource.activeSourceBuffers"); |
test.done(); |
}, "Test addSourceBuffer() with Vorbis and VP8"); |
- |
+ |
mediasource_test(function(test, mediaElement, mediaSource) |
{ |
var videoMimetype = 'video/webm;codecs="vp8"'; |
@@ -67,6 +75,32 @@ |
mediasource_test(function(test, mediaElement, mediaSource) |
{ |
+ var mimetype = MediaSourceUtil.VIDEO_ONLY_TYPE; |
+ |
+ assert_true(MediaSource.isTypeSupported(mimetype), mimetype + " is supported"); |
+ |
+ var sourceBuffer = mediaSource.addSourceBuffer(mimetype); |
+ assert_true(sourceBuffer != null, "New SourceBuffer returned"); |
+ assert_equals(mediaSource.sourceBuffers[0], sourceBuffer, "SourceBuffer is in mediaSource.sourceBuffers"); |
+ assert_equals(mediaSource.activeSourceBuffers[0], sourceBuffer, "SourceBuffer is in mediaSource.activeSourceBuffers"); |
+ test.done(); |
+ }, "Test addSourceBuffer() video only"); |
+ |
+ mediasource_test(function(test, mediaElement, mediaSource) |
+ { |
+ var mimetype = MediaSourceUtil.AUDIO_ONLY_TYPE; |
+ |
+ assert_true(MediaSource.isTypeSupported(mimetype), mimetype + " is supported"); |
+ |
+ var sourceBuffer = mediaSource.addSourceBuffer(mimetype); |
+ assert_true(sourceBuffer != null, "New SourceBuffer returned"); |
+ assert_equals(mediaSource.sourceBuffers[0], sourceBuffer, "SourceBuffer is in mediaSource.sourceBuffers"); |
+ assert_equals(mediaSource.activeSourceBuffers[0], sourceBuffer, "SourceBuffer is in mediaSource.activeSourceBuffers"); |
+ test.done(); |
+ }, "Test addSourceBuffer() audio only"); |
+ |
+ mediasource_test(function(test, mediaElement, mediaSource) |
+ { |
var mimetype = 'video/mp4;codecs="avc1.4D4001,mp4a.40.2"'; |
assert_true(MediaSource.isTypeSupported(mimetype), mimetype + " is supported"); |