OLD | NEW |
1 <!doctype html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>media controls mute button with MediaController</title> | 4 <title>drag timebar reftest</title> |
5 <script src="media-file.js"></script> | 5 <script src=media-controls.js></script> |
6 <script src="media-controls.js"></script> | 6 <script src=media-file.js></script> |
7 </head> | 7 </head> |
8 <body> | 8 <body> |
9 <video controls mediagroup="x"></video> | 9 <video controls></video> |
10 <script> | 10 <script> |
11 if (window.testRunner) | 11 if (window.testRunner) |
12 testRunner.waitUntilDone(); | 12 testRunner.waitUntilDone(); |
13 | 13 |
14 var video = document.querySelector("video"); | 14 var video = document.querySelector("video"); |
15 video.src = findMediaFile("video", "content/test"); | 15 video.src = findMediaFile("video", "content/test"); |
16 video.addEventListener("loadeddata", function() | 16 video.addEventListener("loadeddata", function() |
17 { | 17 { |
| 18 video.play(); |
| 19 |
18 if (window.eventSender) { | 20 if (window.eventSender) { |
19 // click the mute button | 21 var coords = mediaControlsButtonCoordinates(video, "timeline
"); |
20 var coords = mediaControlsButtonCoordinates(video, "mute-but
ton"); | |
21 eventSender.mouseMoveTo(coords[0], coords[1]); | 22 eventSender.mouseMoveTo(coords[0], coords[1]); |
22 eventSender.mouseDown(); | 23 eventSender.mouseDown(); |
23 eventSender.mouseUp(); | 24 } |
24 | 25 |
25 // wait for the volumechange event | 26 if (window.testRunner) |
26 video.addEventListener("volumechange", function() | 27 testRunner.notifyDone(); |
27 { | |
28 if (window.testRunner) | |
29 testRunner.notifyDone(); | |
30 }); | |
31 } | |
32 }); | 28 }); |
33 </script> | 29 </script> |
34 </body> | 30 </body> |
35 </html> | 31 </html> |
OLD | NEW |