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'); |