| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 { | 53 { |
| 54 // Add sufficient segments to have at least 2s of play-time. | 54 // Add sufficient segments to have at least 2s of play-time. |
| 55 var playbackData = MediaSourceUtil.getMediaDataForPlaybackTi
me(mediaData, segmentInfo, 2.0); | 55 var playbackData = MediaSourceUtil.getMediaDataForPlaybackTi
me(mediaData, segmentInfo, 2.0); |
| 56 test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer'); | 56 test.expectEvent(sourceBuffer, 'updateend', 'sourceBuffer'); |
| 57 test.expectEvent(mediaElement, 'playing', 'Playing media.'); | 57 test.expectEvent(mediaElement, 'playing', 'Playing media.'); |
| 58 sourceBuffer.appendBuffer(playbackData); | 58 sourceBuffer.appendBuffer(playbackData); |
| 59 }); | 59 }); |
| 60 | 60 |
| 61 test.waitForExpectedEvents(function() | 61 test.waitForExpectedEvents(function() |
| 62 { | 62 { |
| 63 assert_equals(mediaElement.duration, segmentInfo.duration); | 63 assert_equals(mediaElement.duration, segmentInfo.durationInI
nitSegment); |
| 64 assert_greater_than_equal(mediaElement.duration, 2.0, 'Durat
ion is >2.0s.'); | 64 assert_greater_than_equal(mediaElement.duration, 2.0, 'Durat
ion is >2.0s.'); |
| 65 test.waitForCurrentTimeChange(mediaElement, function() | 65 test.waitForCurrentTimeChange(mediaElement, function() |
| 66 { | 66 { |
| 67 // Update duration. | 67 // Update duration. |
| 68 mediaSource.duration = 1.5; | 68 mediaSource.duration = 1.5; |
| 69 seekToSpecifiedTimeSetEOSAndVerifyDone(test, mediaElemen
t, mediaSource, 1.8); | 69 seekToSpecifiedTimeSetEOSAndVerifyDone(test, mediaElemen
t, mediaSource, 1.8); |
| 70 }); | 70 }); |
| 71 }); | 71 }); |
| 72 }, 'Test seeking beyond updated media duration.'); | 72 }, 'Test seeking beyond updated media duration.'); |
| 73 | 73 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 86 test.waitForCurrentTimeChange(mediaElement, function() | 86 test.waitForCurrentTimeChange(mediaElement, function() |
| 87 { | 87 { |
| 88 seekToSpecifiedTimeSetEOSAndVerifyDone(test, mediaElemen
t, mediaSource, mediaSource.duration, mediaSource.duration + 0.1); | 88 seekToSpecifiedTimeSetEOSAndVerifyDone(test, mediaElemen
t, mediaSource, mediaSource.duration, mediaSource.duration + 0.1); |
| 89 }); | 89 }); |
| 90 }); | 90 }); |
| 91 | 91 |
| 92 }, 'Test seeking beyond media duration.'); | 92 }, 'Test seeking beyond media duration.'); |
| 93 </script> | 93 </script> |
| 94 </body> | 94 </body> |
| 95 </html> | 95 </html> |
| OLD | NEW |