Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / media / video-controls-visible-audio-only.html
bloba267a3837abcc74028a6c759c16c64130fdebc63
1 <!DOCTYPE html>
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();
16 var video;
18 function consoleWrite(text)
20 var console = document.getElementById("console");
21 console.innerHTML += text + "<br>";
24 function testcondition(testFuncString, endit)
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>");
32 function start()
34 video = document.getElementById("no-video-media");
36 testcondition("video.paused");
37 if (!window.testRunner)
38 return;
40 // start playback
41 var playCoords
42 try {
43 playCoords = mediaControlsButtonCoordinates(video, "play-button");
44 } catch (exception) {
45 consoleWrite(exception.description);
46 testRunner.notifyDone();
47 return;
49 var clickX = playCoords[0];
50 var clickY = playCoords[1];
51 eventSender.mouseMoveTo(clickX, clickY);
52 eventSender.mouseDown();
53 eventSender.mouseUp();
54 testcondition("!video.paused");
56 // move the mouse off of the element
57 target = document.getElementById("mouse-parking");
58 eventSender.mouseMoveTo(target.offsetLeft + 4, target.offsetTop + 4);
60 // controller should still be visible after a second
61 setTimeout(function() { testRunner.notifyDone(); } , 1000);
64 if (window.testRunner) {
65 setTimeout(function() {
66 document.body.appendChild(document.createTextNode('FAIL'));
67 if (window.testRunner)
68 testRunner.notifyDone();
69 } , 8000);
72 </script>
73 </head>
74 <body >
76 <p>Test video element control visibility when mouse is not over element.</p>
77 <p>This test only runs in DRT!</p>
79 <p><span id="mouse-parking">mouse parks here, am I blue?</span></p>
81 <video id="no-video-media" controls loop oncanplaythrough="start()"></video>
82 <br><br><div id="console"></div>
83 <script>
84 setSrcById("no-video-media", findMediaFile("audio", "content/test"));
85 </script>
86 </body>
87 </html>