|
Lines 10-16
LayoutTests/media/track/track-cue-container-rendering-position.html_sec1
|
| 10 |
<script> |
10 |
<script> |
| 11 |
|
11 |
|
| 12 |
var cueDisplayElement; |
12 |
var cueDisplayElement; |
| 13 |
|
13 |
var retries = 0; |
|
|
14 |
var maxRetries = 256; |
| 15 |
|
| 14 |
function testPosition() |
16 |
function testPosition() |
| 15 |
{ |
17 |
{ |
| 16 |
if (!window.internals) { |
18 |
if (!window.internals) { |
|
Lines 18-25
LayoutTests/media/track/track-cue-container-rendering-position.html_sec2
|
| 18 |
return; |
20 |
return; |
| 19 |
} |
21 |
} |
| 20 |
|
22 |
|
|
|
23 |
// The textTrackDisplayElement call will fail and throw an exception if the text track display element |
| 24 |
// has not yet been added to the text track container element. We wait until it has been added. |
| 25 |
try { |
| 26 |
cueDisplayElement = textTrackDisplayElement(video, 'display', 0); |
| 27 |
} catch (exception) { |
| 28 |
retries++; |
| 29 |
if (retries > maxRetries) { |
| 30 |
consoleWrite("The test failed because the text track display element was not found."); |
| 31 |
endTest(); |
| 32 |
} |
| 33 |
else |
| 34 |
setTimeout(testPosition, 100); |
| 35 |
return; |
| 36 |
} |
| 37 |
|
| 21 |
consoleWrite(""); |
38 |
consoleWrite(""); |
| 22 |
cueDisplayElement = textTrackDisplayElement(video, 'display', 0); |
|
|
| 23 |
document.body.offsetTop; |
39 |
document.body.offsetTop; |
| 24 |
testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .70)", true); |
40 |
testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .70)", true); |
| 25 |
endTest(); |
41 |
endTest(); |
|
Lines 31-37
LayoutTests/media/track/track-cue-container-rendering-position.html_sec3
|
| 31 |
|
47 |
|
| 32 |
findMediaElement(); |
48 |
findMediaElement(); |
| 33 |
video.src = findMediaFile('video', '../content/test'); |
49 |
video.src = findMediaFile('video', '../content/test'); |
| 34 |
waitForEvent('canplaythrough', function () {setTimeout(testPosition, 100);}); |
50 |
waitForEvent('canplaythrough', testPosition); |
| 35 |
} |
51 |
} |
| 36 |
|
52 |
|
| 37 |
setCaptionDisplayMode('Automatic'); |
53 |
setCaptionDisplayMode('Automatic'); |