OLD | NEW |
1 <!doctype html> | 1 <!DOCTYPE html> |
2 <title>Slow loading WebVTT file interrupted just after a cue text linebreak</tit
le> | 2 <title>Slow loading WebVTT file interrupted just after a cue text linebreak.</ti
tle> |
3 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 3 <script src="../../resources/testharness.js"></script> |
4 (Please avoid writing new tests using video-test.js) --> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 <script src=/media-resources/video-test.js></script> | |
6 <script> | 5 <script> |
7 function loadAndStall() | 6 async_test(function(t) { |
8 { | 7 var video = document.createElement("video"); |
9 return "http://127.0.0.1:8000/resources/load-and-stall.php"; | 8 var track = document.createElement("track"); |
10 } | 9 video.appendChild(track); |
11 | 10 |
12 function vttTrack() | 11 track.onload = t.step_func_done(function() { |
13 { | 12 assert_equals(track.track.cues.length, 2); |
14 return "?name=../../../media/track/captions-webvtt/captions-multiline-lf.vtt
&mimeType=text%2Fvtt"; | 13 assert_equals(track.track.cues[0].text, "Lorem\u000aipsum"); |
15 } | 14 }); |
16 | 15 |
17 window.onload = function() | 16 track.onerror = t.unreached_func(); |
18 { | 17 |
19 video = document.createElement('video'); | 18 var loadAndStallUrl = "http://127.0.0.1:8000/resources/load-and-stall.php"; |
20 track = document.createElement('track'); | 19 var vttTrackUrl = "?name=../../../media/track/captions-webvtt/captions-multi
line-lf.vtt&mimeType=text%2Fvtt"; |
21 video.appendChild(track); | 20 track.src = loadAndStallUrl + vttTrackUrl + "&stallAt=49&stallFor=1"; |
22 track.onload = function() { | |
23 testExpected("track.track.cues.length", 2, "==="); | |
24 testExpected("track.track.cues[0].text", 'Lorem\u000aipsum', "==="); | |
25 endTest(); | |
26 }; | |
27 track.onerror = function() { | |
28 failTest(); | |
29 }; | |
30 track.src = loadAndStall() + vttTrack() + "&stallAt=49&stallFor=1"; | |
31 track.track.mode = "hidden"; | 21 track.track.mode = "hidden"; |
32 } | 22 }); |
33 </script> | 23 </script> |
34 <p>Slow loading WebVTT file interrupted just after a cue text linebreak.</p> | |
OLD | NEW |