graouts@webkit.org | 0d180e7 | 2017-01-20 12:17:50 +0000 | [diff] [blame] | 1 | <!-- webkit-test-runner [ enableModernMediaControls=false ] --> |
eric@webkit.org | b3328a1 | 2009-10-23 20:35:15 +0000 | [diff] [blame] | 2 | <html> |
| 3 | <head> |
| 4 | <title>Test rendering of volume slider of video tag</title> |
mihaip@chromium.org | 9d9ccc1 | 2011-02-24 23:10:46 +0000 | [diff] [blame] | 5 | <script src=media-file.js></script> |
philn@webkit.org | 3042a8e | 2011-05-16 07:07:50 +0000 | [diff] [blame] | 6 | <script src=media-controls.js></script> |
eric@webkit.org | b3328a1 | 2009-10-23 20:35:15 +0000 | [diff] [blame] | 7 | <script> |
| 8 | var video; |
| 9 | |
| 10 | function init() |
| 11 | { |
rniwa@webkit.org | 0837233 | 2012-06-15 07:33:22 +0000 | [diff] [blame] | 12 | if (window.testRunner) |
| 13 | testRunner.waitUntilDone(); |
eric@webkit.org | b3328a1 | 2009-10-23 20:35:15 +0000 | [diff] [blame] | 14 | |
calvaris@igalia.com | f7c6451 | 2014-02-13 11:28:34 +0000 | [diff] [blame] | 15 | internals.suspendAnimations(); // Volumebar can be animated and we would need a timeout to have it shown. |
| 16 | |
eric@webkit.org | b3328a1 | 2009-10-23 20:35:15 +0000 | [diff] [blame] | 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) { |
eric.carlson@apple.com | 1a446c7 | 2011-09-14 22:44:31 +0000 | [diff] [blame] | 26 | var muteCoords; |
philn@webkit.org | 3042a8e | 2011-05-16 07:07:50 +0000 | [diff] [blame] | 27 | try { |
| 28 | muteCoords = mediaControlsButtonCoordinates(video, "mute-button"); |
| 29 | } catch (exception) { |
rniwa@webkit.org | 0837233 | 2012-06-15 07:33:22 +0000 | [diff] [blame] | 30 | testRunner.notifyDone(); |
eric.carlson@apple.com | 1a446c7 | 2011-09-14 22:44:31 +0000 | [diff] [blame] | 31 | return; |
philn@webkit.org | 3042a8e | 2011-05-16 07:07:50 +0000 | [diff] [blame] | 32 | } |
| 33 | eventSender.mouseMoveTo(muteCoords[0], muteCoords[1]); |
eric@webkit.org | b3328a1 | 2009-10-23 20:35:15 +0000 | [diff] [blame] | 34 | } |
| 35 | |
philn@webkit.org | 41b8caa | 2011-02-16 11:10:13 +0000 | [diff] [blame] | 36 | video.addEventListener("volumechange", function() { |
rniwa@webkit.org | 0837233 | 2012-06-15 07:33:22 +0000 | [diff] [blame] | 37 | if (window.testRunner) |
| 38 | testRunner.notifyDone(); |
philn@webkit.org | 41b8caa | 2011-02-16 11:10:13 +0000 | [diff] [blame] | 39 | }); |
eric@webkit.org | b3328a1 | 2009-10-23 20:35:15 +0000 | [diff] [blame] | 40 | } |
| 41 | </script> |
| 42 | </head> |
| 43 | <body onload="init()"> |
| 44 | Tests if the volume slider is rendererd properly. This test assumes the<br> |
calvaris@igalia.com | 5f5b189 | 2013-09-01 11:23:35 +0000 | [diff] [blame] | 45 | volume slider is implemented and mouse over the right bottom corner of<br> |
eric@webkit.org | b3328a1 | 2009-10-23 20:35:15 +0000 | [diff] [blame] | 46 | video element will show the volume slider.<br> |
| 47 | <video oncanplaythrough="test()" controls></video> |
| 48 | </body> |
| 49 | </html> |