Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / media / media-captions-no-controls.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         <script>
10
11             function canplaythrough()
12             {
13                 consoleWrite("<br>** Initial state: no text tracks, controls should not be visible **");
14                 testExpected("video.textTracks.length", 0);
15                 testExpected("video.controls", false, '==');
16
17                 consoleWrite("<br>** Add a text track, controls should not become visible **");
18                 run("video.addTextTrack('captions')");
19                 testExpected("video.textTracks.length", 1);
20                 testExpected("video.controls", false);
21
22                 consoleWrite("<br>** Enable controls **");
23                 run("video.setAttribute('controls','controls')");
24                 testExpected("video.textTracks.length", 1);
25                 testExpected("video.controls", true);
26                 panel = mediaControlsButton(video, "panel");
27                 testExpected("internals.shadowRoot(video).firstChild", null, "!=");
28                 testExpected("panel.style['display']", 'none', "!=");
29
30                 consoleWrite("");
31                 endTest();
32             }
33
34             function start()
35             {
36                 findMediaElement();
37
38                 waitForEvent('canplaythrough', canplaythrough);
39                 video.src = findMediaFile("video", "content/test");
40             }
41
42         </script>
43     </head>
44     <body onload="start()">
45         <video>
46         </video>
47         <p>Tests that adding a text track does not make controls visible.</p>
48     </body>
49 </html>