OLD | NEW |
1 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=61461">bug 61461</a
>: | 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> | 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> | 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> | 4 <script src="full-screen-test.js"></script> |
5 <script src="../media/media-file.js"></script> | 5 <script src="../media/media-file.js"></script> |
6 <script> | 6 <script> |
7 | 7 |
8 function canplaythrough() { | 8 function canplaythrough() { |
9 var frame = document.getElementById('frame'); | 9 var frame = document.getElementById('frame'); |
10 | 10 |
11 runWithKeyDown(function() { | 11 runWithKeyDown(function() { |
12 setTimeout(function() { | |
13 consoleWrite("FAIL - did not enter full screen!"); | |
14 endTest(); | |
15 }, 100); | |
16 | |
17 var video = frame.contentDocument.getElementsByTagName('video')[0]; | 12 var video = frame.contentDocument.getElementsByTagName('video')[0]; |
18 video.webkitEnterFullScreen(); | 13 video.webkitEnterFullScreen(); |
19 }); | 14 }); |
20 } | 15 } |
21 | 16 |
22 function runTest() { | 17 function runTest() { |
23 var frame = document.getElementById('frame'); | 18 var frame = document.getElementById('frame'); |
24 | 19 |
25 waitForEvent(frame.contentDocument, 'webkitfullscreenchange', function() { | 20 waitForEvent(frame.contentDocument, 'webkitfullscreenchange', function() { |
26 test("document.getElementById('frame').contentDocument.width==docume
nt.width") | 21 test("document.getElementById('frame').contentDocument.width==docume
nt.width") |
27 endTest(); | 22 endTest(); |
28 }); | 23 }); |
29 | 24 |
30 var video = frame.contentDocument.getElementsByTagName('video')[0]; | 25 var video = frame.contentDocument.getElementsByTagName('video')[0]; |
31 var mediaFile = findMediaFile("video", "../../media/content/test"); | 26 var mediaFile = findMediaFile("video", "../../media/content/test"); |
32 video.src = mediaFile; | 27 video.src = mediaFile; |
33 video.addEventListener('canplaythrough', canplaythrough); | 28 video.addEventListener('canplaythrough', canplaythrough); |
34 } | 29 } |
35 </script> | 30 </script> |
36 <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"> |
37 </iframe> | 32 </iframe> |
OLD | NEW |