blob: 15a7a530158895d44adc33186297c04be9c2133f [file] [log] [blame]
<script>
if (window.testRunner) {
if (testRunner.setShouldDecideNavigationPolicyAfterDelay)
testRunner.setShouldDecideNavigationPolicyAfterDelay(true);
testRunner.dumpAsText();
}
function runTest() {
var result = document.getElementById('result');
var text = document.getElementById('iframe').contentDocument.documentElement.outerText;
if (text == 'REPLACED')
result.innerHTML = 'SUCCESS';
else
result.innerHTML = 'FAILURE - Got "' + text + '"';
}
</script>
<body>
<div>This tests that calling document.open on a document that has a pending load correctly cancels the load</div>
<div id="result"></div>
<script language="JavaScript" type="text/javascript">
document.write('<iframe id="iframe" src="data:text/html,Should not be seen" onload="runTest()"></iframe>')
var oRTE = frames[0].document;
oRTE.open("text/html","replace");
oRTE.write("REPLACED");
oRTE.close();
</script>
</body>