[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / video-controls-visible-audio-only.html
1 <!DOCTYPE html><!-- webkit-test-runner [ enableModernMediaControls=false ] -->
2 <html>
3     <head>
4         <style>
5             #no-video-media { background-color: yellow; width: 320px; height: 100px;} 
6             #mouse-parking:hover { padding:8; background-color: blue; }
7         </style>
8         <script src=media-file.js></script>
9         <script src=media-controls.js></script>
10         <script>
11             if (window.testRunner) {
12                 testRunner.dumpAsText();
13                 testRunner.waitUntilDone();
14             }
15
16             var video;
17
18             function consoleWrite(text)
19             {
20                 var console = document.getElementById("console");
21                 console.innerHTML += text + "<br>";
22             }
23             
24             function testcondition(testFuncString, endit)
25             {
26                 if (eval(testFuncString))
27                     consoleWrite("TEST(" + testFuncString + ") <span style='color:green'>OK</span>");
28                 else
29                     consoleWrite("TEST(" + testFuncString + ") <span style='color:red'>FAIL</span>");    
30             }
31             
32             function start()
33             {
34                 video = document.getElementById("no-video-media");
35
36                 testcondition("video.paused");
37                 if (!window.testRunner)
38                     return;
39
40                 try {
41                     clickPlayButton(video);
42                 } catch (exception) {
43                     consoleWrite(exception.description);
44                     testRunner.notifyDone();
45                     return;
46                 }
47                 testcondition("!video.paused");
48
49                 // move the mouse off of the element
50                 target = document.getElementById("mouse-parking");
51                 eventSender.mouseMoveTo(target.offsetLeft + 4, target.offsetTop + 4);
52
53                 // controller should still be visible after a second
54                 setTimeout(function() { testRunner.notifyDone(); } , 1000);
55             }
56
57             if (window.testRunner) {
58                 setTimeout(function() { 
59                     document.body.appendChild(document.createTextNode('FAIL')); 
60                     if (window.testRunner)
61                         testRunner.notifyDone();
62                 } , 8000);
63             }
64
65         </script>
66     </head>
67     <body >
68
69         <p>Test video element control visibility when mouse is not over element.</p>
70         <p>This test only runs in DRT!</p>
71
72         <p><span id="mouse-parking">mouse parks here, am I blue?</span></p>
73
74         <video id="no-video-media" controls loop oncanplaythrough="start()"></video>
75         <br><br><div id="console"></div>
76         <script>
77             setSrcById("no-video-media", findMediaFile("audio", "content/test"));
78         </script>
79     </body>
80 </html>