Add new access object callback
[framework/web/webkit-efl.git] / LayoutTests / media / video-controls-zoomed.html
1 <html>
2 <head>
3   <title>Test controls with zooming</title>
4   <style type="text/css" media="screen">
5     video {
6       margin: 50px;
7     }
8   </style>
9   <script src=media-file.js></script>
10   <script src=media-controls.js></script>
11   <script type="text/javascript" charset="utf-8">
12     function runTest()
13     {
14       window.setTimeout(function() {
15         document.documentElement.style.zoom = '150%';
16         video.addEventListener("playing", function() {
17             testExpected("video.paused", false);
18             endTest();
19         });
20
21         if (window.eventSender)
22         {
23             // Find the play button and click the middle of its bounding box.
24             var playCoords;
25             try {
26                 playCoords = mediaControlsButtonCoordinates(video, "play-button");
27             } catch (exception) {
28                 failTest(exception.description);
29                 return;
30             }
31             var clickX = playCoords[0];
32             var clickY = playCoords[1];
33
34             // Apply the page zoom value to the coordinates because
35             // getBoundingClientRect() used in
36             // mediaControlsButtonCoordinates() doesn't do it.
37             clickX = clickX * 1.5;
38             clickY = clickY * 1.5;
39
40             eventSender.mouseMoveTo(clickX, clickY);
41             eventSender.mouseDown();
42             eventSender.mouseUp();
43         }
44       }, 50);
45     }
46   </script>
47 </head>
48 <body>
49     <video controls></video>
50     <p>Test controls on zoomed video.</p>
51     <p>This test only runs in DRT!</p>
52     <script src=video-test.js></script>
53     <script>
54         testExpected("video.controls", null, '!=');
55         waitForEvent('canplaythrough', function() {
56             runTest();
57         } );
58         video.src = findMediaFile("video", "content/test");
59     </script>
60 </body>
61 </html>
62
63