blob: 1facb11a2e53b8d696b819db106dd97ac06ffbaf [file] [log] [blame]
jer.noble@apple.comb3d68412016-05-11 16:20:20 +00001<!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.org4c7be232018-09-11 12:47:54 +000025 run('document.scrollingElement.scrollTop = document.body.clientHeight');
jer.noble@apple.comb3d68412016-05-11 16:20:20 +000026 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.org4c7be232018-09-11 12:47:54 +000047</html>