OLD | NEW |
1 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=61461">bug 61461</a
>: | 1 <p>HTMLVideoElement.webkitEnterFullScreen() in an iframe requires the allowfulls
creen attribute</p> |
2 Handle entering full screen security restrictions</p> | |
3 <p>To test manually, click the video "full screen" button - the page should ente
r full screen mode.</p> | |
4 <script src="full-screen-test.js"></script> | 2 <script src="full-screen-test.js"></script> |
5 <script src="../media/media-file.js"></script> | 3 <script src="../media/media-file.js"></script> |
6 <script> | 4 <script> |
7 | 5 |
8 function canplaythrough() { | 6 function canplaythrough() { |
9 var frame = document.getElementById('frame'); | 7 var frame = document.getElementById('frame'); |
10 | 8 |
11 runWithKeyDown(function() { | 9 runWithKeyDown(function() { |
12 var video = frame.contentDocument.getElementsByTagName('video')[0]; | 10 var video = frame.contentDocument.getElementsByTagName('video')[0]; |
13 video.webkitEnterFullScreen(); | 11 video.webkitEnterFullScreen(); |
14 }); | 12 }); |
15 } | 13 } |
16 | 14 |
17 function runTest() { | 15 function runTest() { |
18 var frame = document.getElementById('frame'); | 16 var frame = document.getElementById('frame'); |
19 | 17 |
20 waitForEvent(frame.contentDocument, 'webkitfullscreenchange', function() { | 18 waitForEventAndEnd(frame.contentDocument, 'webkitfullscreenerror'); |
21 test("document.getElementById('frame').contentDocument.width==docume
nt.width") | |
22 endTest(); | |
23 }); | |
24 | 19 |
25 var video = frame.contentDocument.getElementsByTagName('video')[0]; | 20 var video = frame.contentDocument.getElementsByTagName('video')[0]; |
26 var mediaFile = findMediaFile("video", "../../media/content/test"); | 21 var mediaFile = findMediaFile("video", "../../media/content/test"); |
27 video.src = mediaFile; | 22 video.src = mediaFile; |
28 video.addEventListener('canplaythrough', canplaythrough); | 23 video.addEventListener('canplaythrough', canplaythrough); |
29 } | 24 } |
30 </script> | 25 </script> |
31 <iframe id="frame" src="resources/legacy.html" onload="runTest()" width="336" he
ight="256"> | 26 <iframe id="frame" src="resources/legacy.html" onload="runTest()" width="336" he
ight="256"> |
32 </iframe> | 27 </iframe> |
OLD | NEW |