blob: f313c1e20e359223c5b9b2761e9e0cceb3c1c6e5 [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function getSubframeHistory()
{
try {
return window.frames[0].history;
} catch (e) {
console.log(e);
}
}
window.onmessage = function(evt)
{
if (evt.data != "done") {
alert("Unexpected message: " + evt.data);
testRunner.notifyDone();
return;
}
alert("Child window's history object after attempt to clear: " + getSubframeHistory());
testRunner.notifyDone();
}
function setHistoryLength()
{
alert("Child window's history object before attempt to clear: " + getSubframeHistory());
window.frames[0].postMessage("setHistoryLength", "*");
}
</script>
</head>
<body onload="setHistoryLength();">
<iframe id='testFrame' src="http://localhost:8000/history/resources/cross-origin-replaces-history-object-child-iframe.html"></iframe>
</body>
</html>