Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / media / track / track-cue-container-rendering-position.html
1 <!DOCTYPE html>
2 <html>
3     <head>
4         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
6         <script src=../media-file.js></script>
7         <script src=../video-test.js></script>
8         <script src=../media-controls.js></script>
9
10         <script>
11
12         var cueDisplayElement;
13
14         function testPosition()
15         {
16             if (!window.internals) {
17                 consoleWrite("<br><b>** This test only works in DRT! **<" + "/b>");
18                 return;
19             }
20
21             consoleWrite("");
22             cueDisplayElement = textTrackDisplayElement(video, 'display', 0);
23             document.body.offsetTop; // Force layout.
24             testExpected("cueDisplayElement.offsetTop > (video.videoHeight * .75)", true);
25             endTest();
26         }
27
28         function loaded()
29         {
30             consoleWrite("The top of the text track container should be in the bottom 25% of the video element.");
31
32             findMediaElement();
33             video.src = findMediaFile('video', '../content/test');
34             waitForEvent('canplaythrough', testPosition);
35         }
36
37         </script>
38     </head>
39     <body onload="loaded()">
40         <video controls>
41             <track src="captions-webvtt/captions-snap-to-lines-not-set.vtt" kind="captions" >
42             <track src="captions-webvtt/simple-captions.vtt" kind="captions" >
43             <track src="captions-webvtt/sorted-dispatch.vtt" kind="captions" >
44             <track src="captions-webvtt/captions-fast.vtt" kind="captions" >
45             <track src="captions-webvtt/captions-html.vtt" kind="captions" >
46             <track src="captions-webvtt/captions.vtt" kind="captions" default>
47         </video>
48     </body>
49 </html>