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

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

Issue 742653002: MSE: Add layout test for 'decode' error via an algorithm (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use (length - 1)/2 to get the harf index Created 6 years, 1 month 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-errors.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 test.waitForExpectedEvents(function() 317 test.waitForExpectedEvents(function()
318 { 318 {
319 assert_false(sourceBuffer.updating, 'updating attribute is fals e'); 319 assert_false(sourceBuffer.updating, 'updating attribute is fals e');
320 test.done(); 320 test.done();
321 }); 321 });
322 }, 'Test appending a neutered ArrayBuffer.'); 322 }, 'Test appending a neutered ArrayBuffer.');
323 323
324 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData) 324 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData)
325 { 325 {
326 var initSegment = MediaSourceUtil.extractSegmentData(mediaData, se gmentInfo.init); 326 var initSegment = MediaSourceUtil.extractSegmentData(mediaData, se gmentInfo.init);
327 var halfIndex = (initSegment.length + 1) / 2; 327 var halfIndex = (initSegment.length - 1) / 2;
328 var partialInitSegment = initSegment.subarray(0, halfIndex); 328 var partialInitSegment = initSegment.subarray(0, halfIndex);
329 var remainingInitSegment = initSegment.subarray(halfIndex); 329 var remainingInitSegment = initSegment.subarray(halfIndex);
330 var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, s egmentInfo.media[0]); 330 var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, s egmentInfo.media[0]);
331 331
332 test.expectEvent(sourceBuffer, 'updateend', 'partialInitSegment ap pend ended.'); 332 test.expectEvent(sourceBuffer, 'updateend', 'partialInitSegment ap pend ended.');
333 sourceBuffer.appendBuffer(partialInitSegment); 333 sourceBuffer.appendBuffer(partialInitSegment);
334 334
335 test.waitForExpectedEvents(function() 335 test.waitForExpectedEvents(function()
336 { 336 {
337 assert_equals(mediaElement.readyState, mediaElement.HAVE_NOTHI NG); 337 assert_equals(mediaElement.readyState, mediaElement.HAVE_NOTHI NG);
(...skipping 18 matching lines...) Expand all
356 assert_equals(sourceBuffer.updating, false); 356 assert_equals(sourceBuffer.updating, false);
357 assert_equals(mediaSource.readyState, 'open'); 357 assert_equals(mediaSource.readyState, 'open');
358 test.done(); 358 test.done();
359 }); 359 });
360 }, 'Test appendBuffer with partial init segments.'); 360 }, 'Test appendBuffer with partial init segments.');
361 361
362 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData) 362 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData)
363 { 363 {
364 var initSegment = MediaSourceUtil.extractSegmentData(mediaData, se gmentInfo.init); 364 var initSegment = MediaSourceUtil.extractSegmentData(mediaData, se gmentInfo.init);
365 var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, s egmentInfo.media[0]); 365 var mediaSegment = MediaSourceUtil.extractSegmentData(mediaData, s egmentInfo.media[0]);
366 var halfIndex = (mediaSegment.length + 1) / 2; 366 var halfIndex = (mediaSegment.length - 1) / 2;
367 var partialMediaSegment = mediaSegment.subarray(0, halfIndex); 367 var partialMediaSegment = mediaSegment.subarray(0, halfIndex);
368 var remainingMediaSegment = mediaSegment.subarray(halfIndex); 368 var remainingMediaSegment = mediaSegment.subarray(halfIndex);
369 369
370 test.expectEvent(sourceBuffer, 'updateend', 'InitSegment append en ded.'); 370 test.expectEvent(sourceBuffer, 'updateend', 'InitSegment append en ded.');
371 test.expectEvent(mediaElement, 'loadedmetadata', 'loadedmetadata d one.'); 371 test.expectEvent(mediaElement, 'loadedmetadata', 'loadedmetadata d one.');
372 sourceBuffer.appendBuffer(initSegment); 372 sourceBuffer.appendBuffer(initSegment);
373 373
374 test.waitForExpectedEvents(function() 374 test.waitForExpectedEvents(function()
375 { 375 {
376 assert_equals(mediaElement.readyState, mediaElement.HAVE_METAD ATA); 376 assert_equals(mediaElement.readyState, mediaElement.HAVE_METAD ATA);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 mediaSource.removeSourceBuffer(sourceBuffer); 555 mediaSource.removeSourceBuffer(sourceBuffer);
556 556
557 assert_throws( { name: 'InvalidStateError'} , 557 assert_throws( { name: 'InvalidStateError'} ,
558 function() { sourceBuffer.appendBuffer(mediaData); }, 558 function() { sourceBuffer.appendBuffer(mediaData); },
559 'appendBuffer() throws an exception when called after removeSo urceBuffer().'); 559 'appendBuffer() throws an exception when called after removeSo urceBuffer().');
560 test.done(); 560 test.done();
561 }, 'Test appending after removeSourceBuffer().'); 561 }, 'Test appending after removeSourceBuffer().');
562 </script> 562 </script>
563 </body> 563 </body>
564 </html> 564 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-errors.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698