jer.noble@apple.com | b3d6841 | 2016-05-11 16:20:20 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>video-main-content-allow</title> |
| 5 | <script src="video-test.js"></script> |
| 6 | <script src="media-file.js"></script> |
| 7 | <script> |
| 8 | function go() { |
| 9 | video = document.createElement('video'); |
| 10 | run('internals.setMediaElementRestrictions(video, "RequireUserGestureForVideoRateChange,OverrideUserGestureRequirementForMainContent")'); |
| 11 | document.body.appendChild(video); |
| 12 | var spacer = document.body.appendChild(document.createElement('div')); |
| 13 | spacer.id = 'spacer'; |
| 14 | |
| 15 | video.src = findMediaFile('video', 'content/test'); |
| 16 | waitForEvent('canplaythrough', canPlayThrough); |
| 17 | } |
| 18 | |
| 19 | function canPlayThrough() { |
| 20 | video.play(); |
| 21 | waitForEvent('playing', playing); |
| 22 | } |
| 23 | |
| 24 | function playing() { |
commit-queue@webkit.org | 4c7be23 | 2018-09-11 12:47:54 +0000 | [diff] [blame] | 25 | run('document.scrollingElement.scrollTop = document.body.clientHeight'); |
jer.noble@apple.com | b3d6841 | 2016-05-11 16:20:20 +0000 | [diff] [blame] | 26 | waitForEventAndFail('pause'); |
| 27 | setTimeout(afterPlaying, 100); |
| 28 | } |
| 29 | |
| 30 | function afterPlaying() { |
| 31 | testExpected('video.paused', false); |
| 32 | endTest(); |
| 33 | } |
| 34 | </script> |
| 35 | <style> |
| 36 | html, body, #spacer { |
| 37 | height: 100%; |
| 38 | } |
| 39 | video { |
| 40 | width: 600px; |
| 41 | height: 400px; |
| 42 | } |
| 43 | </style> |
| 44 | </head> |
| 45 | <body onload="go()"> |
| 46 | </body> |
commit-queue@webkit.org | 4c7be23 | 2018-09-11 12:47:54 +0000 | [diff] [blame] | 47 | </html> |