blob: ce0b30bfe6c9cd3210323f85ddd27bf53776454b [file] [log] [blame]
<html>
<head>
<script src="../resources/cross-frame-access.js"></script>
</head>
<body>
<p>This test passes as long as the word 'FAIL' and an accompanying message do not appear in the subframe.</p>
<pre id='console'></pre>
<iframe id='aFrame' src='http://localhost:8000/security/resources/cross-frame-iframe.html'></iframe>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.dumpChildFramesAsText();
layoutTestController.waitUntilDone();
}
var innerFrame = window.frames[0];
var testDone = false;
setTimeout(test, 1);
setTimeout(function() {
if (!testDone) {
log("FAIL: Test timed out");
if (window.layoutTestController)
layoutTestController.notifyDone();
}
}, 2000);
function test() {
var flag = innerFrame.frames[0];
if (!flag) {
setTimeout(test, 1);
return;
}
var newSrc = document.createAttribute("src");
newSrc.value = 'javascript:"FAIL: this should not have been loaded."';
document.getElementById('aFrame').setAttributeNodeNS(newSrc);
testDone = true;
if (window.layoutTestController)
layoutTestController.notifyDone();
}
</script>
</body>
</html>