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

Unified Diff: LayoutTests/http/tests/media/media-source/mediasource-endofstream-invaliderror.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
Index: LayoutTests/http/tests/media/media-source/mediasource-endofstream-invaliderror.html
diff --git a/LayoutTests/http/tests/media/media-source/mediasource-endofstream-invaliderror.html b/LayoutTests/http/tests/media/media-source/mediasource-endofstream-invaliderror.html
index 0ac4b63758f79d29a8f2724d8607c0769480e71b..1c86c9ab5e8246487419a91a05a0eacb667788d0 100644
--- a/LayoutTests/http/tests/media/media-source/mediasource-endofstream-invaliderror.html
+++ b/LayoutTests/http/tests/media/media-source/mediasource-endofstream-invaliderror.html
@@ -40,6 +40,54 @@
test.failOnEvent(mediaElement, 'error');
assert_equals(mediaSource.readyState, 'open');
+ test.expectEvent(mediaSource, 'sourceend');
+ mediaSource.endOfStream();
+
+ assert_equals(mediaSource.readyState, 'ended');
+ assert_throws("InvalidStateError",
+ function() { mediaSource.endOfStream(); },
+ "endofStream() threw an exception when in ended state");
+
+ test.done();
+ }, 'Test MediaSource.endOfStream() with when readyState is ended.');
+
+ mediasource_test(function(test, mediaElement, mediaSource)
+ {
+ test.failOnEvent(mediaElement, 'error');
+ assert_equals(mediaSource.readyState, 'open');
+
+ test.expectEvent(mediaSource, 'sourceend');
+ mediaSource.endOfStream();
+
+ assert_equals(mediaSource.readyState, 'ended');
+ assert_throws("InvalidStateError",
+ function() { mediaSource.endOfStream("decode"); },
+ "endofStream() threw an exception when in ended state");
+
+ test.done();
+ }, 'Test MediaSource.endOfStream(decode) with when readyState is ended.');
+
+ mediasource_test(function(test, mediaElement, mediaSource)
+ {
+ test.failOnEvent(mediaElement, 'error');
+ assert_equals(mediaSource.readyState, 'open');
+
+ test.expectEvent(mediaSource, 'sourceend');
+ mediaSource.endOfStream();
+
+ assert_equals(mediaSource.readyState, 'ended');
+ assert_throws("InvalidStateError",
+ function() { mediaSource.endOfStream("network"); },
+ "endofStream() threw an exception when in ended state");
+
+ test.done();
+ }, 'Test MediaSource.endOfStream(network) with when readyState is ended.');
+
+ mediasource_test(function(test, mediaElement, mediaSource)
+ {
+ test.failOnEvent(mediaElement, 'error');
+ assert_equals(mediaSource.readyState, 'open');
+
assert_throws(new TypeError(),
function() { mediaSource.endOfStream(null); },
'endOfStream(null) throws TypeError');

Powered by Google App Engine
This is Rietveld 408576698