[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / video-volume-slider.html
1 <!-- webkit-test-runner [ enableModernMediaControls=false ] -->
2 <html>
3 <head>
4     <title>Test rendering of volume slider of video tag</title>
5     <script src=media-file.js></script>
6     <script src=media-controls.js></script>
7     <script>
8         var video;
9
10         function init()
11         {
12             if (window.testRunner)
13                 testRunner.waitUntilDone();
14
15             internals.suspendAnimations(); // Volumebar can be animated and we would need a timeout to have it shown.
16
17             video = document.getElementsByTagName("video")[0];
18             video.src = findMediaFile("video", "content/test");
19         }
20
21         function test()
22         {
23             video.volume = 0.7;
24
25             if (window.eventSender) {
26                 var muteCoords;
27                 try {
28                     muteCoords = mediaControlsButtonCoordinates(video, "mute-button");
29                 } catch (exception) {
30                     testRunner.notifyDone();
31                     return;
32                 }
33                 eventSender.mouseMoveTo(muteCoords[0], muteCoords[1]);
34             }
35
36             video.addEventListener("volumechange", function() {
37                  if (window.testRunner)
38                      testRunner.notifyDone();
39             });
40         }
41     </script>
42 </head>
43 <body onload="init()">
44     Tests if the volume slider is rendererd properly. This test assumes the<br>
45     volume slider is implemented and mouse over the right bottom corner of<br>
46     video element will show the volume slider.<br>
47     <video oncanplaythrough="test()" controls></video>
48 </body>
49 </html>