5 #no-video-media { background-color: yellow; width:
320px; height:
100px;}
6 #mouse-parking:hover { padding:
8; background-color: blue; }
8 <script src=media-file.js
></script>
9 <script src=media-controls.js
></script>
11 if (window
.testRunner
) {
12 testRunner
.dumpAsText();
13 testRunner
.waitUntilDone();
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>");
29 consoleWrite("TEST(" + testFuncString
+ ") <span style='color:red'>FAIL</span>");
34 video
= document
.getElementById("no-video-media");
36 testcondition("video.paused");
37 if (!window
.testRunner
)
43 playCoords
= mediaControlsButtonCoordinates(video
, "play-button");
45 consoleWrite(exception
.description
);
46 testRunner
.notifyDone();
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();
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>
84 setSrcById("no-video-media", findMediaFile("audio", "content/test"));