blob: 2db1abd65aec4787b91cf0df7ebf51e1c4fd190e [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
testRunner.waitUntilDone();
}
window.onload = function()
{
var innerURL = "data:text/html,<html>"
+ "<head>"
+ "<scr" + "ipt>"
+ "function test() {"
+ "try {"
+ "parent.document.getElementById(\"accessMe\").innerHTML = \"FAIL: Cross frame access from a data: URL was allowed.\";"
+ "} catch (e) {"
+ "console.log(e);"
+ "}"
+ "if (window.testRunner)"
+ "testRunner.notifyDone();"
+ "}"
+ "</scr" + "ipt>"
+ "</head>"
+ "<body onload=\"test();\">"
+ "<p>Inner-inner iframe.</p>"
+ "</body>"
+ "</html>";
var url = "data:text/html,<html>"
+ "<body>"
+ "<p id='accessMe'>PASS: Cross frame access from a data: URL was denied.</p>"
+ "<p>Inner iframe.</p>"
+ "<iframe name='innerFrame' id='innerFrame' src='" + innerURL + "'></iframe>"
+ "</body>"
+ "</html>";
var iframe = document.getElementById("aFrame");
iframe.src = url;
}
</script>
</head>
<body>
<p>This tests that a data: URL loaded in an iframe inside another data: URL loaded iframe doesn't have access to its parent, the
first data: URL loaded iframe.</p>
<iframe id="aFrame" name="aFrame" style="width: 500px; height: 300px;"></iframe>
</body>
</html>