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