blob: c86590e52a82ba181da7917a91342f4dd32dd01a [file] [log] [blame]
graouts@webkit.org0d180e72017-01-20 12:17:50 +00001<!-- webkit-test-runner [ enableModernMediaControls=false ] -->
eric@webkit.orgb3328a12009-10-23 20:35:15 +00002<html>
3<head>
4 <title>Test rendering of volume slider of video tag</title>
mihaip@chromium.org9d9ccc12011-02-24 23:10:46 +00005 <script src=media-file.js></script>
philn@webkit.org3042a8e2011-05-16 07:07:50 +00006 <script src=media-controls.js></script>
eric@webkit.orgb3328a12009-10-23 20:35:15 +00007 <script>
8 var video;
9
10 function init()
11 {
rniwa@webkit.org08372332012-06-15 07:33:22 +000012 if (window.testRunner)
13 testRunner.waitUntilDone();
eric@webkit.orgb3328a12009-10-23 20:35:15 +000014
calvaris@igalia.comf7c64512014-02-13 11:28:34 +000015 internals.suspendAnimations(); // Volumebar can be animated and we would need a timeout to have it shown.
16
eric@webkit.orgb3328a12009-10-23 20:35:15 +000017 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) {
eric.carlson@apple.com1a446c72011-09-14 22:44:31 +000026 var muteCoords;
philn@webkit.org3042a8e2011-05-16 07:07:50 +000027 try {
28 muteCoords = mediaControlsButtonCoordinates(video, "mute-button");
29 } catch (exception) {
rniwa@webkit.org08372332012-06-15 07:33:22 +000030 testRunner.notifyDone();
eric.carlson@apple.com1a446c72011-09-14 22:44:31 +000031 return;
philn@webkit.org3042a8e2011-05-16 07:07:50 +000032 }
33 eventSender.mouseMoveTo(muteCoords[0], muteCoords[1]);
eric@webkit.orgb3328a12009-10-23 20:35:15 +000034 }
35
philn@webkit.org41b8caa2011-02-16 11:10:13 +000036 video.addEventListener("volumechange", function() {
rniwa@webkit.org08372332012-06-15 07:33:22 +000037 if (window.testRunner)
38 testRunner.notifyDone();
philn@webkit.org41b8caa2011-02-16 11:10:13 +000039 });
eric@webkit.orgb3328a12009-10-23 20:35:15 +000040 }
41 </script>
42</head>
43<body onload="init()">
44 Tests if the volume slider is rendererd properly. This test assumes the<br>
calvaris@igalia.com5f5b1892013-09-01 11:23:35 +000045 volume slider is implemented and mouse over the right bottom corner of<br>
eric@webkit.orgb3328a12009-10-23 20:35:15 +000046 video element will show the volume slider.<br>
47 <video oncanplaythrough="test()" controls></video>
48</body>
49</html>