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 <script src=../video-test.js></script> | 7 <script src=../video-test.js></script> |
8 <script> | 8 <script> |
9 | 9 |
10 var numberOfTrackTests = 2; | 10 var numberOfTrackTests = 2; |
11 | 11 |
12 function trackLoaded() | 12 function trackLoaded() |
13 { | 13 { |
14 numberOfTracksLoaded++; | 14 numberOfTracksLoaded++; |
15 if (numberOfTracksLoaded == numberOfTrackTests) { | 15 if (numberOfTracksLoaded == numberOfTrackTests) { |
16 testTrack(0); | 16 testTrack(0); |
17 testTrackError(1); | 17 testTrackError(1); |
18 } | 18 } |
19 } | 19 } |
20 | 20 |
21 | 21 |
22 function testTrack(i) | 22 function testTrack(i) |
23 { | 23 { |
24 findMediaElement(); | 24 findMediaElement(); |
25 var expected = | 25 var expected = |
26 { | 26 { |
27 length : 6, | 27 length : 7, |
28 tests: | 28 tests: |
29 [ | 29 [ |
30 { | 30 { |
31 property : "getCueAsHTML().textContent", | 31 property : "getCueAsHTML().textContent", |
32 values : ["This cue has an amp & character.", | 32 values : ["This cue has an ampersand & character.", |
33 "This cue has a less than < character.", | 33 "This cue has a less than < character.", |
34 "This cue has a greater than > character."
, | 34 "This cue has a greater than > character."
, |
35 "This cue has a Left-to-Right Mark \u200e.
", | 35 "This cue has a Left-to-Right Mark \u200e.
", |
36 "This cue has a Right-to-Left Mark \u200f.
", | 36 "This cue has a Right-to-Left Mark \u200f.
", |
37 "This cue has a non-breaking space \u00a0.
"], | 37 "This cue has a non-breaking space \u00a0.
", |
| 38 "This & is parsed to the same as &."], |
38 }, | 39 }, |
39 ], | 40 ], |
40 }; | 41 }; |
41 testCues(i, expected); | 42 testCues(i, expected); |
42 | 43 |
43 allTestsEnded(); | 44 allTestsEnded(); |
44 } | 45 } |
45 | 46 |
46 function testTrackError(i) | 47 function testTrackError(i) |
47 { | 48 { |
48 findMediaElement(); | 49 findMediaElement(); |
49 var expected = | 50 var expected = |
50 { | 51 { |
51 length : 3, | 52 length : 2, |
52 tests: | 53 tests: |
53 [ | 54 [ |
54 { | 55 { |
55 property : "getCueAsHTML().textContent", | 56 property : "getCueAsHTML().textContent", |
56 values : ["This cue has an amp character.\nAmpersand
is ignored.", | 57 values : ["This cue has a less than ", |
57 "This cue has a less than ", | |
58 "This cue has a greater than > character.\
nSince it's not related to a < character,\nit's just interpreted as text."], | 58 "This cue has a greater than > character.\
nSince it's not related to a < character,\nit's just interpreted as text."], |
59 }, | 59 }, |
60 ], | 60 ], |
61 }; | 61 }; |
62 testCues(i, expected); | 62 testCues(i, expected); |
63 | 63 |
64 allTestsEnded(); | 64 allTestsEnded(); |
65 } | 65 } |
66 </script> | 66 </script> |
67 </head> | 67 </head> |
68 <body onload="enableAllTextTracks()"> | 68 <body onload="enableAllTextTracks()"> |
69 <p>Tests entities in the cue text.</p> | 69 <p>Tests entities in the cue text.</p> |
70 <video> | 70 <video> |
71 <track src="captions-webvtt/tc022-entities.vtt" onload="trackLoaded(
)"> | 71 <track src="captions-webvtt/tc022-entities.vtt" onload="trackLoaded(
)"> |
72 <track src="captions-webvtt/tc022-entities-wrong.vtt" onload="trackL
oaded()"> | 72 <track src="captions-webvtt/tc022-entities-wrong.vtt" onload="trackL
oaded()"> |
73 </video> | 73 </video> |
74 </body> | 74 </body> |
75 </html> | 75 </html> |
OLD | NEW |