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