Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 14 matching lines...) Expand all Loading... | |
| 25 assert_equals(sourceBuffer.appendWindowEnd, 400.0, "appendWindowEn d is correctly reset'"); | 25 assert_equals(sourceBuffer.appendWindowEnd, 400.0, "appendWindowEn d is correctly reset'"); |
| 26 test.done(); | 26 test.done(); |
| 27 }, "Test correctly reset appendWindowStart and appendWindowEnd values" ); | 27 }, "Test correctly reset appendWindowStart and appendWindowEnd values" ); |
| 28 | 28 |
| 29 mediasource_test(function(test, mediaElement, mediaSource) | 29 mediasource_test(function(test, mediaElement, mediaSource) |
| 30 { | 30 { |
| 31 var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.AUD IO_VIDEO_TYPE); | 31 var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.AUD IO_VIDEO_TYPE); |
| 32 assert_true(sourceBuffer != null, "New SourceBuffer returned"); | 32 assert_true(sourceBuffer != null, "New SourceBuffer returned"); |
| 33 sourceBuffer.appendWindowEnd = 500.0; | 33 sourceBuffer.appendWindowEnd = 500.0; |
| 34 | 34 |
| 35 assert_throws("TypeMismatchError", | 35 assert_throws({name: "TypeError"}, |
|
acolwell GONE FROM CHROMIUM
2014/03/26 16:41:36
nit: Why can't we just use "TypeError"? It seems o
sof
2014/03/26 16:43:37
It'd be nice, but testharness.js only handles DOM
| |
| 36 function() { sourceBuffer.appendWindowStart = Number.NEGATIVE_ INFINITY; }, | 36 function() { sourceBuffer.appendWindowStart = Number.NEGATIVE_ INFINITY; }, |
| 37 "set appendWindowStart throws an exception for Number.NEGATIVE _INFINITY."); | 37 "set appendWindowStart throws an exception for Number.NEGATIVE _INFINITY."); |
| 38 | 38 |
| 39 assert_throws("TypeMismatchError", | 39 assert_throws({name: "TypeError"}, |
| 40 function() { sourceBuffer.appendWindowStart = Number.POSITIVE_ INFINITY; }, | 40 function() { sourceBuffer.appendWindowStart = Number.POSITIVE_ INFINITY; }, |
| 41 "set appendWindowStart throws an exception for Number.POSITIVE _INFINITY."); | 41 "set appendWindowStart throws an exception for Number.POSITIVE _INFINITY."); |
| 42 | 42 |
| 43 assert_throws("TypeMismatchError", | 43 assert_throws({name: "TypeError"}, |
| 44 function() { sourceBuffer.appendWindowStart = Number.NaN; }, | 44 function() { sourceBuffer.appendWindowStart = Number.NaN; }, |
| 45 "set appendWindowStart throws an exception for Number.NaN."); | 45 "set appendWindowStart throws an exception for Number.NaN."); |
| 46 | 46 |
| 47 assert_throws("InvalidAccessError", | 47 assert_throws("InvalidAccessError", |
| 48 function() { sourceBuffer.appendWindowStart = 600.0; }, | 48 function() { sourceBuffer.appendWindowStart = 600.0; }, |
| 49 "set appendWindowStart throws an exception when greater than a ppendWindowEnd."); | 49 "set appendWindowStart throws an exception when greater than a ppendWindowEnd."); |
| 50 | 50 |
| 51 assert_throws("InvalidAccessError", | 51 assert_throws("InvalidAccessError", |
| 52 function() { sourceBuffer.appendWindowStart = -100.0; }, | 52 function() { sourceBuffer.appendWindowStart = -100.0; }, |
| 53 "set appendWindowStart throws an exception when less than 0.") ; | 53 "set appendWindowStart throws an exception when less than 0.") ; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 }, "Test set appendWindowStart and appendWindowEnd when source buffer updating."); | 94 }, "Test set appendWindowStart and appendWindowEnd when source buffer updating."); |
| 95 | 95 |
| 96 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData) | 96 mediasource_testafterdataloaded(function(test, mediaElement, mediaSour ce, segmentInfo, sourceBuffer, mediaData) |
| 97 { | 97 { |
| 98 test.expectEvent(sourceBuffer, "updateend", "sourceBuffer"); | 98 test.expectEvent(sourceBuffer, "updateend", "sourceBuffer"); |
| 99 sourceBuffer.appendBuffer(mediaData); | 99 sourceBuffer.appendBuffer(mediaData); |
| 100 assert_true(sourceBuffer.updating, "updating attribute is true"); | 100 assert_true(sourceBuffer.updating, "updating attribute is true"); |
| 101 | 101 |
| 102 sourceBuffer.abort(); | 102 sourceBuffer.abort(); |
| 103 assert_equals(sourceBuffer.appendWindowStart, 0, "appendWindowStar t is 0 after an abort'"); | 103 assert_equals(sourceBuffer.appendWindowStart, 0, "appendWindowStar t is 0 after an abort'"); |
| 104 assert_equals(sourceBuffer.appendWindowEnd, Number.POSITIVE_INFINI TY, | 104 assert_equals(sourceBuffer.appendWindowEnd, Number.POSITIVE_INFINI TY, |
| 105 "appendWindowStart is POSITIVE_INFINITY after an abo rt"); | 105 "appendWindowStart is POSITIVE_INFINITY after an abo rt"); |
| 106 test.waitForExpectedEvents(function() | 106 test.waitForExpectedEvents(function() |
| 107 { | 107 { |
| 108 assert_false(sourceBuffer.updating, "updating attribute is fal se"); | 108 assert_false(sourceBuffer.updating, "updating attribute is fal se"); |
| 109 test.done(); | 109 test.done(); |
| 110 }); | 110 }); |
| 111 }, "Test appendWindowStart and appendWindowEnd value after a sourceBuf fer.abort()."); | 111 }, "Test appendWindowStart and appendWindowEnd value after a sourceBuf fer.abort()."); |
| 112 | 112 |
| 113 </script> | 113 </script> |
| 114 </body> | 114 </body> |
| 115 </html> | 115 </html> |
| OLD | NEW |