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 src=../media-controls.js></script> | 8 <script src=../media-controls.js></script> |
9 | 9 |
10 <script> | 10 <script> |
(...skipping 24 matching lines...) Expand all Loading... |
35 2.60, | 35 2.60, |
36 3.10, | 36 3.10, |
37 4.10 | 37 4.10 |
38 ]; | 38 ]; |
39 | 39 |
40 var currentTestCase = 0; | 40 var currentTestCase = 0; |
41 | 41 |
42 function seeked() | 42 function seeked() |
43 { | 43 { |
44 consoleWrite("Active cues: " + testTrack.track.activeCues.length); | 44 consoleWrite("Active cues: " + testTrack.track.activeCues.length); |
45 | |
46 for (var i = 0; i < testTrack.track.activeCues.length; ++i) { | 45 for (var i = 0; i < testTrack.track.activeCues.length; ++i) { |
47 | |
48 cueDisplayElement = textTrackDisplayElement(video, 'display', i)
; | 46 cueDisplayElement = textTrackDisplayElement(video, 'display', i)
; |
49 | 47 |
50 consoleWrite(""); | 48 consoleWrite(""); |
51 consoleWrite("* Cue " + i + " *"); | 49 consoleWrite("* Cue " + i + " *"); |
52 testExpected("cueDisplayElement.innerText", testTrack.track.acti
veCues[i].text); | 50 testExpected("cueDisplayElement.innerText", testTrack.track.acti
veCues[i].text); |
| 51 consoleWrite("Cue alignment (default or as specified): " + testT
rack.track.activeCues[i].align); |
53 | 52 |
54 consoleWrite("Cue left position (percentage): " + Math.round(cue
DisplayElement.offsetLeft / cueDisplayContainer.offsetWidth * 100)); | 53 consoleWrite("Cue left position (percentage): " + Math.round(cue
DisplayElement.offsetLeft / cueDisplayContainer.offsetWidth * 100)); |
55 consoleWrite("Cue top position (percentage): " + Math.round(cueD
isplayElement.offsetTop / cueDisplayContainer.offsetHeight * 100)); | 54 consoleWrite("Cue top position (percentage): " + Math.round(cueD
isplayElement.offsetTop / cueDisplayContainer.offsetHeight * 100)); |
56 } | 55 } |
57 | 56 |
58 runNextTestCase(); | 57 runNextTestCase(); |
59 }; | 58 }; |
60 | 59 |
61 function runNextTestCase() | 60 function runNextTestCase() |
62 { | 61 { |
63 if (currentTestCase == testCaseDescription.length) { | 62 if (currentTestCase == testCaseDescription.length) { |
64 endTest(); | 63 endTest(); |
65 return; | 64 return; |
66 } | 65 } |
67 | 66 |
68 consoleWrite(""); | 67 consoleWrite(""); |
69 consoleWrite("** " + testCaseDescription[currentTestCase] + " **"); | 68 consoleWrite("** " + testCaseDescription[currentTestCase] + " **"); |
70 | 69 |
71 video.currentTime = testCaseSeekTime[currentTestCase]; | 70 video.currentTime = testCaseSeekTime[currentTestCase]; |
72 waitForEvent('seeked', seeked, false, true); | 71 waitForEvent('seeked', seeked, false, true); |
73 | 72 |
74 currentTestCase++; | 73 currentTestCase++; |
75 } | 74 } |
76 | 75 |
77 function testInitialContainer() | |
78 { | |
79 consoleWrite(""); | |
80 consoleWrite("The track container and the media controls should comp
letely cover the video element"); | |
81 testExpected("cueDisplayContainer.offsetHeight + controlsPanelElemen
t.offsetHeight == video.videoHeight", true); | |
82 testExpected("cueDisplayContainer.offsetWidth == video.videoWidth",
true); | |
83 } | |
84 | |
85 function loaded() | 76 function loaded() |
86 { | 77 { |
87 consoleWrite("Test that TextTrack's cues are rendered correctly when
the snap to lines flag is not set."); | 78 consoleWrite("Test that TextTrack's cues are rendered correctly when
the snap to lines flag is not set."); |
88 | 79 |
89 findMediaElement(); | 80 findMediaElement(); |
90 testTrack = document.querySelector('track'); | 81 testTrack = document.querySelector('track'); |
91 video.src = findMediaFile('video', '../content/test'); | 82 video.src = findMediaFile('video', '../content/test'); |
92 | 83 |
93 // In Chromium it is the enclosure element, which provides the contr
ols height, otherwise the panel; | 84 // In Chromium it is the enclosure element, which provides the contr
ols height, otherwise the panel; |
94 // both are the second child in the shadow DOM. | 85 // both are the second child in the shadow DOM. |
95 controlsPanelElement = internals.shadowRoot(video).firstChild.firstC
hild; | 86 controlsPanelElement = internals.shadowRoot(video).firstChild.firstC
hild; |
96 | 87 |
97 waitForEventOnce('canplaythrough', function() { | 88 waitForEventOnce('canplaythrough', function() { |
98 cueDisplayContainer = textTrackDisplayElement(video); | 89 cueDisplayContainer = textTrackDisplayElement(video); |
99 testInitialContainer(); | |
100 runNextTestCase(); | 90 runNextTestCase(); |
101 }); | 91 }); |
102 } | 92 } |
103 | 93 |
104 </script> | 94 </script> |
105 </head> | 95 </head> |
106 <body onload="loaded()"> | 96 <body onload="loaded()"> |
107 <video controls> | 97 <video controls> |
108 <track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind
="captions" default> | 98 <track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind
="captions" default> |
109 </video> | 99 </video> |
110 </body> | 100 </body> |
111 </html> | 101 </html> |
OLD | NEW |