blob: 550c91e015283cfb16379be55b8f054fc17bcfec [file] [log] [blame]
<html>
<head>
<script src="resources/cross-frame-access.js"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
testRunner.waitUntilDone();
}
onload = function()
{
// Add manual run buttons if the browser does not support window.postMessage
if (!window.postMessage) {
log("YOUR BROWSER DOES NOT SUPPORT window.postMessage");
log("To run this test manually, first click the button titled 'Step 1 - Set Test' in this frame.");
log("Then click the button in the sub frame titled 'Step 2 - Set Check' to finish the test.\n");
var button = document.createElement("button");
button.appendChild(document.createTextNode("Step 1 - Set Test"));
button.onclick = setTest;
document.body.appendChild(button);
}
}
receiver = function(e)
{
if (e.data == "storedOldValuesComplete")
setTest();
}
addEventListener('message', receiver, false);
setTest = function()
{
window.targetWindow = frames[0];
try { targetWindow.history.back = "FAIL!! CUSTOM back"; } catch(e) { log(e); }
try { targetWindow.history.forward = "FAIL!! CUSTOM forward"; } catch(e) { log(e); }
try { targetWindow.history.go = "FAIL!! CUSTOM go"; } catch(e) { log(e); }
try { targetWindow.history.toString = "FAIL!! CUSTOM toString"; } catch(e) { log(e); }
try { targetWindow.history.length = "FAIL!! CUSTOM length"; } catch(e) { log(e); }
try { targetWindow.history.customAttribute = "FAIL!! CUSTOM customAttribute"; } catch(e) { log(e); }
if (window.postMessage)
targetWindow.postMessage("settingValuesComplete", "*");
else
log("\nSet Test complete! Click button entitled 'Step 2 - Set Check' to finish the test.");
}
</script>
</head>
<body>
<iframe src="http://localhost:8000/security/resources/cross-frame-iframe-for-history-put-test.html"></iframe>
<pre id="console"></pre>
</body>
</html>