blob: 18998c57aac90a6859eff249fbd4618ae02132f3 [file] [log] [blame]
annacc@chromium.org334e0662011-11-13 00:47:57 +00001<!DOCTYPE html>
2<html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
6 <script src=../media-file.js></script>
7 <script src=../video-test.js></script>
8 <script>
9
10 numberOfTrackTests = 3;
11
12 function trackLoaded()
13 {
14 numberOfTracksLoaded++;
15 if (numberOfTracksLoaded == numberOfTrackTests) {
16 testTrack(0);
17 testTrack(1);
18 testTrackError(2);
19 }
20 }
21
22 function testTrack(i)
23 {
24 findMediaElement();
25 var expected =
26 {
27 length : 2,
28 tests:
29 [
30 {
31 property : "id",
32 values : [1, 2],
33 },
34 {
35 property : "startTime",
36 values : [0.0, 31.0],
37 },
38 {
39 property : "endTime",
40 values : [30.5, 1200.5],
41 },
42 {
eric.carlson@apple.com40e816e2012-01-10 21:14:23 +000043 property : "text",
annacc@chromium.org334e0662011-11-13 00:47:57 +000044 values : ["Bear is Coming!!!!!", "I said Bear is coming!!!!"],
45 },
46 ],
47 };
48 testCues(i, expected);
49
50 allTestsEnded();
51 }
52
53 function testTrackError(i)
54 {
55 findMediaElement();
56 var expected =
57 {
58 length : 0,
59 tests:
60 [],
61 };
62 testCues(i, expected);
63
64 allTestsEnded();
65 }
66 </script>
67 </head>
eric.carlson@apple.comc15ec232011-12-07 04:04:44 +000068 <body onload="enableAllTextTracks()">
annacc@chromium.org334e0662011-11-13 00:47:57 +000069 <p>Tests that the magic file header "WEBVTT" leads to the file properly recognized as a WebVTT file.</p>
70 <video>
71 <track src="captions-webvtt/tc004-webvtt-file.vtt" onload="trackLoaded()">
72 <track src="captions-webvtt/tc004-webvtt-rubbish.vtt" onload="trackLoaded()">
73 <track src="captions-webvtt/tc004-no-webvtt.vtt" onerror="trackLoaded()">
74 </video>
75 </body>
76</html>