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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/media-source/mediasource-remove.html

Issue 2102323002: MSE: Experimental support for new abort and duration behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 }); 130 });
131 }, "Test remove while update pending."); 131 }, "Test remove while update pending.");
132 132
133 mediasource_test(function(test, mediaElement, mediaSource) 133 mediasource_test(function(test, mediaElement, mediaSource)
134 { 134 {
135 var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.AUD IO_VIDEO_TYPE); 135 var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.AUD IO_VIDEO_TYPE);
136 136
137 mediaSource.duration = 10; 137 mediaSource.duration = 10;
138 138
139 test.expectEvent(sourceBuffer, "updatestart"); 139 test.expectEvent(sourceBuffer, "updatestart");
140 test.expectEvent(sourceBuffer, "abort");
141 test.expectEvent(sourceBuffer, "updateend"); 140 test.expectEvent(sourceBuffer, "updateend");
142 sourceBuffer.remove(1, 2); 141 sourceBuffer.remove(1, 2);
143 142
144 assert_true(sourceBuffer.updating, "updating"); 143 assert_true(sourceBuffer.updating, "updating");
145 144
146 sourceBuffer.abort(); 145 assert_throws('InvalidStateError',
146 function() { sourceBuffer.abort(); },
147 'abort() of remove() throws an exception');
147 148
148 assert_false(sourceBuffer.updating, "updating"); 149 assert_true(sourceBuffer.updating, "updating");
149 150
150 test.waitForExpectedEvents(function() 151 test.waitForExpectedEvents(function()
151 { 152 {
152 test.done(); 153 test.done();
153 }); 154 });
154 }, "Test aborting a remove operation."); 155 }, "Test aborting a remove operation throws exception.");
155 156
156 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData) 157 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData)
157 { 158 {
158 sourceBuffer.appendBuffer(mediaData); 159 sourceBuffer.appendBuffer(mediaData);
159 160
160 test.expectEvent(sourceBuffer, "updatestart"); 161 test.expectEvent(sourceBuffer, "updatestart");
161 test.expectEvent(sourceBuffer, "update"); 162 test.expectEvent(sourceBuffer, "update");
162 test.expectEvent(sourceBuffer, "updateend"); 163 test.expectEvent(sourceBuffer, "updateend");
163 164
164 test.waitForExpectedEvents(function() 165 test.waitForExpectedEvents(function()
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 mp4: "{ [0.000, 1.022) }", 283 mp4: "{ [0.000, 1.022) }",
283 }; 284 };
284 285
285 // Using MAX_VALUE rather than POSITIVE_INFINITY here due to lack 286 // Using MAX_VALUE rather than POSITIVE_INFINITY here due to lack
286 // of 'unrestricted' on end parameter. (See comment in SourceBuffe r.idl) 287 // of 'unrestricted' on end parameter. (See comment in SourceBuffe r.idl)
287 removeAndCheckBufferedRanges(test, sourceBuffer, 1, Number.MAX_VAL UE, expectations[subType]); 288 removeAndCheckBufferedRanges(test, sourceBuffer, 1, Number.MAX_VAL UE, expectations[subType]);
288 }, "Test removing the end of appended data."); 289 }, "Test removing the end of appended data.");
289 </script> 290 </script>
290 </body> 291 </body>
291 </html> 292 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698