OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>The top of the text track container should be in the bottom 25% of the vi
deo element.</title> |
3 <head> | 3 <script src="../media-file.js"></script> |
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 <script src="../media-controls.js"></script> |
5 | 5 <script src="../../resources/testharness.js"></script> |
6 <script src=../media-file.js></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
7 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 | 7 <video> |
8 (Please avoid writing new tests using video-test.js) --> | 8 <track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind="captio
ns" > |
9 <script src=../video-test.js></script> | 9 <track src="captions-webvtt/simple-captions.vtt" kind="captions" > |
10 <script src=../media-controls.js></script> | 10 <track src="captions-webvtt/sorted-dispatch.vtt" kind="captions" > |
11 | 11 <track src="captions-webvtt/captions-fast.vtt" kind="captions" > |
12 <script> | 12 <track src="captions-webvtt/captions-html.vtt" kind="captions" > |
13 | 13 <track src="captions-webvtt/captions.vtt" kind="captions" default> |
14 var cueDisplayElement; | 14 </video> |
15 | 15 <script> |
16 function testPosition() | 16 async_test(function(t) { |
17 { | 17 var video = document.querySelector("video"); |
18 if (!window.internals) { | 18 video.src = findMediaFile("video", "../content/test"); |
19 consoleWrite("<br><b>** This test only works in DRT! **<" + "/b>
"); | 19 |
20 return; | 20 video.oncanplaythrough = t.step_func_done(function() { |
21 } | 21 var cueDisplayElement = textTrackDisplayElement(video, "display", 0); |
22 | 22 document.body.offsetTop; // Force layout. |
23 consoleWrite(""); | 23 assert_true(cueDisplayElement.offsetTop > (video.videoHeight * 0.75)); |
24 cueDisplayElement = textTrackDisplayElement(video, 'display', 0); | 24 }); |
25 document.body.offsetTop; // Force layout. | 25 }); |
26 testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .75
)", true); | 26 </script> |
27 endTest(); | |
28 } | |
29 | |
30 function loaded() | |
31 { | |
32 consoleWrite("The top of the text track container should be in the b
ottom 25% of the video element."); | |
33 | |
34 findMediaElement(); | |
35 video.src = findMediaFile('video', '../content/test'); | |
36 waitForEvent('canplaythrough', testPosition); | |
37 } | |
38 | |
39 </script> | |
40 </head> | |
41 <body onload="loaded()"> | |
42 <video controls> | |
43 <track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind
="captions" > | |
44 <track src="captions-webvtt/simple-captions.vtt" kind="captions" > | |
45 <track src="captions-webvtt/sorted-dispatch.vtt" kind="captions" > | |
46 <track src="captions-webvtt/captions-fast.vtt" kind="captions" > | |
47 <track src="captions-webvtt/captions-html.vtt" kind="captions" > | |
48 <track src="captions-webvtt/captions.vtt" kind="captions" default> | |
49 </video> | |
50 </body> | |
51 </html> | |
OLD | NEW |