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