OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src=../../resources/testharness.js></script> |
| 3 <script src=../../resources/testharnessreport.js></script> |
| 4 <script> |
| 5 |
| 6 // Run captureStreamUntilEnded() on different videos, and assert onEnded is fire
d. |
| 7 |
| 8 var makeAsyncTest = function(filename) { |
| 9 async_test(function(test) { |
| 10 var stream; |
| 11 |
| 12 var video = document.createElement('video'); |
| 13 video.src = "../../http/tests/media/resources/media-source/webm/" + filename
; |
| 14 video.onerror = this.unreached_func("<video> error"); |
| 15 video.onloadedmetadata = this.step_func(function() { |
| 16 stream = video.captureStreamUntilEnded(); |
| 17 stream.oninactive = test.step_func_done(function() {}); |
| 18 |
| 19 video.play(); |
| 20 }); |
| 21 video.onplay = this.step_func(function() { |
| 22 // Skip forward till almost the end of the video to speed up the test. |
| 23 video.currentTime = video.duration - 0.1; |
| 24 }); |
| 25 |
| 26 video.load(); |
| 27 }), "<video>.captureStreamUntilEnded() and assert data flows."; |
| 28 }; |
| 29 |
| 30 generate_tests(makeAsyncTest, |
| 31 [[ "video-only", "test-v-128k-320x240-24fps-8kfr.webm"], |
| 32 [ "audio-only", "test-a-128k-44100Hz-1ch.webm"]]); |
| 33 |
| 34 </script> |
OLD | NEW |