summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/loader/local-iFrame-source-from-local.html
blob: 27d0743eedd2d43a6d13f1c0d4681b4113420b21 (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
33
34
35
36
37
38
39
40
41
<html>
<head>
    <script>
        function iFrameTest() {
            if (window.testRunner)
                testRunner.dumpAsText();

            var localPageLocation = "file:///tmp/LayoutTests/http/tests/security/resources/localPage.html";
            if (window.testRunner)
                localPageLocation = testRunner.pathToLocalResource(localPageLocation);

            var localIframeElement = document.createElement("iFrame");
            localIframeElement.setAttribute("id", "myFrame");
            localIframeElement.setAttribute("src", localPageLocation);

            document.body.appendChild(localIframeElement);
    
            var result = document.getElementById("result");

            var myFrameDocument = document.getElementById("myFrame").contentDocument;
            if (myFrameDocument)
                result.innerHTML = "Test Passed. Local page loaded locally into iFrame.";
            else
                result.innerHTML = "Test Failed: Local page not locally loaded into iFrame.";
        }
    </script>
</head>
<body onload="iFrameTest()">
    <div id="div0">
        This test is to see if a local file can include a local page in an iFrame.
        <br/>
        Currently this test cannot be run manually on Windows because we do not have
        a function like pathToLocalResource() outside of DRT.
        <br/>
    </div>
    </br>
    <div id="result">
        Test not run correctly.
    </div>
</body>
</html>