OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Test that cue text is mutable.</title> | 2 <title>Test that cue text is mutable.</title> |
3 <script src="../media-file.js"></script> | 3 <script src="../media-file.js"></script> |
4 <script src="../media-controls.js"></script> | 4 <script src="../media-controls.js"></script> |
5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
7 <video> | 7 <video> |
8 <track src="captions-webvtt/captions-gaps.vtt" kind="captions" default > | 8 <track src="captions-webvtt/captions-gaps.vtt" kind="captions" default > |
9 </video> | 9 </video> |
10 <script> | 10 <script> |
(...skipping 17 matching lines...) Expand all Loading... |
28 assert_equals(testTrack.track.cues[1].startTime, 3.0); | 28 assert_equals(testTrack.track.cues[1].startTime, 3.0); |
29 | 29 |
30 assert_equals(testTrack.track.cues[0].text, "Lorem ipsum dolor sit amet,
"); | 30 assert_equals(testTrack.track.cues[0].text, "Lorem ipsum dolor sit amet,
"); |
31 var fragment = document.createDocumentFragment(); | 31 var fragment = document.createDocumentFragment(); |
32 fragment.appendChild(document.createTextNode("Lorem ipsum dolor sit amet
,")); | 32 fragment.appendChild(document.createTextNode("Lorem ipsum dolor sit amet
,")); |
33 assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML())
); | 33 assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML())
); |
34 | 34 |
35 // Change the start time of cue #1, it should become visible. | 35 // Change the start time of cue #1, it should become visible. |
36 testTrack.track.cues[0].startTime = 0; | 36 testTrack.track.cues[0].startTime = 0; |
37 assert_equals(testTrack.track.cues[0].startTime, 0); | 37 assert_equals(testTrack.track.cues[0].startTime, 0); |
38 assert_equals(textTrackDisplayElement(video, "display").innerText, "Lore
m ipsum dolor sit amet,"); | 38 assert_equals(textTrackDisplayElement(video).innerText, "Lorem ipsum dol
or sit amet,"); |
39 | 39 |
40 // Change the cue text, getCueAsHTML() should return a new, correct frag
ment. | 40 // Change the cue text, getCueAsHTML() should return a new, correct frag
ment. |
41 testTrack.track.cues[0].text = "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>s
it</i> amet,"; | 41 testTrack.track.cues[0].text = "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>s
it</i> amet,"; |
42 assert_equals(testTrack.track.cues[0].text, "Lorem <b>ipsum</b> <u>dolor
</u> <i.sit>sit</i> amet,"); | 42 assert_equals(testTrack.track.cues[0].text, "Lorem <b>ipsum</b> <u>dolor
</u> <i.sit>sit</i> amet,"); |
43 | 43 |
44 fragment = document.createDocumentFragment(); | 44 fragment = document.createDocumentFragment(); |
45 fragment.appendChild(document.createTextNode("Lorem ")); | 45 fragment.appendChild(document.createTextNode("Lorem ")); |
46 | 46 |
47 var bold = document.createElement("b"); | 47 var bold = document.createElement("b"); |
48 bold.appendChild(document.createTextNode("ipsum")); | 48 bold.appendChild(document.createTextNode("ipsum")); |
(...skipping 15 matching lines...) Expand all Loading... |
64 fragment.appendChild(document.createTextNode(" amet,")); | 64 fragment.appendChild(document.createTextNode(" amet,")); |
65 | 65 |
66 assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML())
); | 66 assert_true(fragment.isEqualNode(testTrack.track.cues[0].getCueAsHTML())
); |
67 | 67 |
68 t.done(); | 68 t.done(); |
69 } | 69 } |
70 | 70 |
71 video.src = findMediaFile("video", "../content/counting"); | 71 video.src = findMediaFile("video", "../content/counting"); |
72 }); | 72 }); |
73 </script> | 73 </script> |
OLD | NEW |