[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
[WebKit-https.git] / LayoutTests / media / video-main-content-allow-then-scroll.html
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() {
25         run('document.body.scrollTop = document.body.clientHeight');
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>
47 </html>