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

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

Issue 245893002: Improve unprefixed MediaSource test coverage. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 50134beb7b3d6a4b9291c638432cf2b464b356b2..523a005d269f2362fbc0ea4e5f2a4f40383649f4 100644
--- a/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html
+++ b/LayoutTests/http/tests/media/media-source/mediasource-addsourcebuffer.html
@@ -12,6 +12,15 @@
<script>
mediasource_test(function(test, mediaElement, mediaSource)
{
+ mediaSource.endOfStream();
+ assert_throws("InvalidStateError",
+ function() { mediaSource.addSourceBuffer(MediaSourceUtil.AUDIO_VIDEO_TYPE); },
+ "addSourceBuffer() threw an exception when in 'ended' state.");
+ test.done();
+ }, "Test addSourceBuffer() in 'ended' state.");
+
+ mediasource_test(function(test, mediaElement, mediaSource)
+ {
assert_throws("InvalidAccessError",
function() { mediaSource.addSourceBuffer(""); },
"addSourceBuffer() threw an exception when passed an empty string.");
@@ -26,7 +35,6 @@
test.done();
}, "Test addSourceBuffer() with unsupported type");
-
mediasource_test(function(test, mediaElement, mediaSource)
{
var mimetype = 'video/webm;codecs="vp8,vorbis"';
@@ -86,6 +94,25 @@
assert_equals(mediaSource.activeSourceBuffers[1], sourceBufferB, "sourceBufferB is in mediaSource.activeSourceBuffers");
test.done();
}, "Test addSourceBuffer() with AAC and H.264 in separate SourceBuffers");
+
+ mediasource_test(function(test, mediaElement, mediaSource)
+ {
+ var reachedLimit = false;
+
+ // The 20 here is an arbitrary upper limit to make sure the test terminates. This test
+ // assumes that implementations won't support more than 20 SourceBuffers simultaneously.
+ for (var i = 0; i < 20; ++i) {
+ try {
+ mediaSource.addSourceBuffer(MediaSourceUtil.AUDIO_VIDEO_TYPE);
+ } catch(e) {
+ assert_equals(e.name, "QuotaExceededError");
+ reachedLimit = true;
+ break;
+ }
+ }
+ assert_true(reachedLimit, "Reached SourceBuffer limit.");
+ test.done();
+ }, "Test addSourceBuffer() QuotaExceededError.");
</script>
</body>
</html>
« 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