| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>video-main-content-allow</title> |
| <script src="video-test.js"></script> |
| <script src="media-file.js"></script> |
| <script> |
| function go() { |
| video = document.createElement('video'); |
| run('internals.setMediaElementRestrictions(video, "RequireUserGestureForVideoRateChange,OverrideUserGestureRequirementForMainContent")'); |
| document.body.appendChild(video); |
| var spacer = document.body.appendChild(document.createElement('div')); |
| spacer.id = 'spacer'; |
| |
| video.src = findMediaFile('video', 'content/test'); |
| waitForEvent('canplaythrough', canPlayThrough); |
| } |
| |
| function canPlayThrough() { |
| video.play(); |
| waitForEvent('playing', playing); |
| } |
| |
| function playing() { |
| run('document.scrollingElement.scrollTop = document.body.clientHeight'); |
| waitForEventAndFail('pause'); |
| setTimeout(afterPlaying, 100); |
| } |
| |
| function afterPlaying() { |
| testExpected('video.paused', false); |
| endTest(); |
| } |
| </script> |
| <style> |
| html, body, #spacer { |
| height: 100%; |
| } |
| video { |
| width: 600px; |
| height: 400px; |
| } |
| </style> |
| </head> |
| <body onload="go()"> |
| </body> |
| </html> |