4 <script src=
"video-test.js"></script>
6 var startTest = function() {
7 if (!window
.eventSender
) {
8 logResult(false, "This test requires window.eventSender.");
13 var rect
= video
.getBoundingClientRect();
14 consoleWrite("Click on the center of the video element.");
15 var x
= rect
.left
+ rect
.width
/ 2;
16 var y
= rect
.top
+ rect
.height
/ 2;
17 eventSender
.mouseMoveTo(x
, y
);
18 eventSender
.mouseDown();
19 eventSender
.mouseUp();
20 testExpected("document.activeElement.id", "video", "!=");
22 consoleWrite("Click on the play button.");
23 eventSender
.mouseMoveTo(rect
.left
+ 20, rect
.top
+ rect
.height
- 20);
24 eventSender
.mouseDown();
25 eventSender
.mouseUp();
26 testExpected("document.activeElement.id", "video", "!=");
32 <body onload=
"startTest();">
33 <p>This tests that a mouse click event will not cause a media element to gain focus.
</p>
34 <video id=
"video" controls
></video>