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 </head> | 10 </head> |
9 <body> | 11 <body> |
10 <p>Tests the load event on HTMLTrackElement and LOADED readyState on Tex
tTrack when src is set from JavaScript.</p> | 12 <p>Tests the load event on HTMLTrackElement and LOADED readyState on Tex
tTrack when src is set from JavaScript.</p> |
11 <video> | 13 <video> |
12 <track id="testTrackEmpty"> | 14 <track id="testTrackEmpty"> |
13 </video> | 15 </video> |
14 <script> | 16 <script> |
15 | 17 |
16 function trackLoaded() | 18 function trackLoaded() |
17 { | 19 { |
18 consoleWrite("EVENT(load)"); | 20 consoleWrite("EVENT(load)"); |
19 testExpected("track.readyState", HTMLTrackElement.LOADED); | 21 testExpected("track.readyState", HTMLTrackElement.LOADED); |
20 endTest(); | 22 endTest(); |
21 } | 23 } |
22 | 24 |
23 track = document.getElementById('testTrackEmpty'); | 25 track = document.getElementById('testTrackEmpty'); |
24 testExpected("track.readyState", HTMLTrackElement.NONE); | 26 testExpected("track.readyState", HTMLTrackElement.NONE); |
25 track.addEventListener("load", function () { trackLoaded(); }, true)
; | 27 track.addEventListener("load", function () { trackLoaded(); }, true)
; |
26 track.src = "captions-webvtt/tc004-webvtt-file.vtt"; | 28 track.src = "captions-webvtt/tc004-webvtt-file.vtt"; |
27 track.track.mode = "hidden"; | 29 track.track.mode = "hidden"; |
28 | 30 |
29 </script> | 31 </script> |
30 </body> | 32 </body> |
31 </html> | 33 </html> |
OLD | NEW |