OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <title>Test that media autoplay should not work if user gesture is requi
red for playback</title> |
| 4 <script src=media-file.js></script> |
| 5 <script src=video-test.js></script> |
| 6 <script> |
| 7 if (window.internals) |
| 8 window.internals.settings.setMediaPlaybackRequiresUserGesture(tr
ue); |
| 9 |
| 10 function testPlay() |
| 11 { |
| 12 failTest("play event should not fire without user gesture."); |
| 13 } |
| 14 |
| 15 function testPaused() |
| 16 { |
| 17 testExpected("video.paused", true); |
| 18 endTest(); |
| 19 } |
| 20 |
| 21 function canplaythrough() |
| 22 { |
| 23 setTimeout(testPaused, 100); |
| 24 } |
| 25 |
| 26 function start() |
| 27 { |
| 28 findMediaElement(); |
| 29 video.src = findMediaFile("video", "content/test"); |
| 30 testExpected("video.paused", true); |
| 31 waitForEvent('canplaythrough', canplaythrough); |
| 32 waitForEvent('play', testPlay); |
| 33 } |
| 34 </script> |
| 35 </head> |
| 36 |
| 37 <body onload="start()"> |
| 38 <p>Test that media autoplay should not work if user gesture is required for
playback.</p> |
| 39 <video controls autoplay></video> |
| 40 </body> |
| 41 </html> |
OLD | NEW |