Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html

Issue 267333006: Adding a few new MSE tests based on the spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing CR comments Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698