summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-legacy.html
blob: 6a3bb524f23052417b1df9e6c95ca15f3293509b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=61461">bug 61461</a>: 
Handle entering full screen security restrictions</p>
<p>To test manually, click the video "full screen" button - the page should enter full screen mode.</p>
<script src="full-screen-test.js"></script>
<script src="../media/media-file.js"></script>
<script>

function canplaythrough() {
    var frame = document.getElementById('frame');

    runWithKeyDown(function() {
        var video = frame.contentDocument.getElementsByTagName('video')[0];
        video.webkitEnterFullScreen();
    });
}

function runTest() {
    var frame = document.getElementById('frame');

    waitForEvent(frame.contentDocument, 'webkitfullscreenchange', function() {
            test("document.getElementById('frame').contentDocument.width==document.width")
            endTest();
    });

    var video = frame.contentDocument.getElementsByTagName('video')[0];
    var mediaFile = findMediaFile("video", "../../media/content/test");
    video.src = mediaFile;
    video.addEventListener('canplaythrough', canplaythrough);
}
</script>
<iframe id="frame" src="resources/legacy.html" onload="runTest()" width="336" height="256">
</iframe>