OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
5 | 5 |
6 <script src=../media-file.js></script> | 6 <script src=../media-file.js></script> |
| 7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 8 (Please avoid writing new tests using video-test.js) --> |
7 <script src=../video-test.js></script> | 9 <script src=../video-test.js></script> |
8 | 10 |
9 <script> | 11 <script> |
10 | 12 |
11 var cueCount = 0; | 13 var cueCount = 0; |
12 var currentCue; | 14 var currentCue; |
13 var testTrack; | 15 var testTrack; |
14 | 16 |
15 var trackLoaded = false; | 17 var trackLoaded = false; |
16 var videoCanPlayThrough = false; | 18 var videoCanPlayThrough = false; |
17 | 19 |
18 function attemptTests() | 20 function attemptTests() |
19 { | 21 { |
(...skipping 26 matching lines...) Expand all Loading... |
46 { | 48 { |
47 consoleWrite("EVENT(exit)"); | 49 consoleWrite("EVENT(exit)"); |
48 consoleWrite(""); | 50 consoleWrite(""); |
49 | 51 |
50 ++cueCount; | 52 ++cueCount; |
51 if (cueCount == testTrack.track.cues.length) | 53 if (cueCount == testTrack.track.cues.length) |
52 endTest(); | 54 endTest(); |
53 } | 55 } |
54 | 56 |
55 waitForEvent('canplaythrough', | 57 waitForEvent('canplaythrough', |
56 function () | 58 function () |
57 { | 59 { |
58 videoCanPlayThrough = true; | 60 videoCanPlayThrough = true; |
59 attemptTests(); | 61 attemptTests(); |
60 } | 62 } |
61 ); | 63 ); |
62 | 64 |
63 function loaded() | 65 function loaded() |
64 { | 66 { |
65 trackLoaded = true; | 67 trackLoaded = true; |
66 attemptTests(); | 68 attemptTests(); |
67 } | 69 } |
68 | 70 |
69 function start() | 71 function start() |
70 { | 72 { |
71 findMediaElement(); | 73 findMediaElement(); |
72 video.src = findMediaFile("video", "../content/test"); | 74 video.src = findMediaFile("video", "../content/test"); |
73 } | 75 } |
74 </script> | 76 </script> |
75 </head> | 77 </head> |
76 <body onload="start()"> | 78 <body onload="start()"> |
77 <p>Tests that TextTrack's cues are indexed and updated in order during v
ideo playback. Test uses the enter and exits events on TextTrackCue.</p> | 79 <p>Tests that TextTrack's cues are indexed and updated in order during v
ideo playback. Test uses the enter and exits events on TextTrackCue.</p> |
78 <video controls> | 80 <video controls> |
79 <track id="testTrack" src="captions-webvtt/cues-chrono-order.vtt" ki
nd="captions" onload="loaded()" default> | 81 <track id="testTrack" src="captions-webvtt/cues-chrono-order.vtt" ki
nd="captions" onload="loaded()" default> |
80 </video> | 82 </video> |
81 </body> | 83 </body> |
82 </html> | 84 </html> |
OLD | NEW |