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

Side by Side Diff: LayoutTests/http/tests/media/media-source/mediasource-closed.html

Issue 419673007: Adding more MSE tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing debug messages Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="/w3c/resources/testharness.js"></script> 4 <script src="/w3c/resources/testharness.js"></script>
5 <script src="/w3c/resources/testharnessreport.js"></script> 5 <script src="/w3c/resources/testharnessreport.js"></script>
6 <script src="mediasource-util.js"></script> 6 <script src="mediasource-util.js"></script>
7 <link rel='stylesheet' href='/w3c/resources/testharness.css'> 7 <link rel='stylesheet' href='/w3c/resources/testharness.css'>
8 </head> 8 </head>
9 <body> 9 <body>
10 <div id="log"></div> 10 <div id="log"></div>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 mediaSource.addEventListener('sourceclose', test.step_func(functio n (event) 108 mediaSource.addEventListener('sourceclose', test.step_func(functio n (event)
109 { 109 {
110 assert_equals(mediaSource.readyState, "closed", "readyState is 'closed'"); 110 assert_equals(mediaSource.readyState, "closed", "readyState is 'closed'");
111 assert_true(Number.isNaN(mediaSource.duration), "duration is N aN"); 111 assert_true(Number.isNaN(mediaSource.duration), "duration is N aN");
112 test.done(); 112 test.done();
113 })); 113 }));
114 114
115 // Trigger the MediaSource to close. 115 // Trigger the MediaSource to close.
116 mediaElement.src = ""; 116 mediaElement.src = "";
117 }, "Test getting duration while open->closed."); 117 }, "Test getting duration while open->closed.");
118
119 mediasource_test(function(test, mediaElement, mediaSource)
120 {
121 var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.AUD IO_ONLY_TYPE);
122
123 assert_equals(mediaSource.readyState, "open", "readyState is 'open '");
wolenetz 2014/07/26 00:07:15 nit: eek! ditto (" vs ')
prabhur1 2014/07/28 21:36:49 Done.
124
125 // Setup a handler to run when the MediaSource closes.
126 mediaSource.addEventListener('sourceclose', test.step_func(functio n (event)
127 {
128 assert_equals(mediaSource.readyState, "closed", "readyState is 'closed'");
129 assert_throws("InvalidStateError",
130 function() { sourceBuffer.abort(); },
131 "sourceBuffer.abort() throws INVALID_STATE_ERROR");
wolenetz 2014/07/26 00:07:16 nit: remove any trailing whitespace here
prabhur1 2014/07/28 21:36:49 Done.
132 test.done();
133 }));
134
135 // Trigger the MediaSource to close.
136 mediaElement.src = "";
137 }, "Test sourcebuffer.abort when closed.");
118 </script> 138 </script>
119 </body> 139 </body>
120 </html> 140 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698