blob: dd045d3807d6e2341d3afd1e2d7aaa5e1d971efc [file] [log] [blame]
<p>This test checks for a NULL document crash that can happen when setting
location.href. If the test passes, you'll see a PASS message below.</p>
<hr>
<pre id="pre"></pre>
<iframe style="visibility:hidden" src="does-not-exist.bogus"></iframe> <!-- forces asynchronous load -->
<script>
<!--
function log(s)
{
document.getElementById("pre").appendChild(document.createTextNode(s));
}
function test()
{
frames[0].location.href = "javascript:'<script>parent.pass()</script>'";
}
function pass()
{
log("PASS: You didn't crash.");
if (window.layoutTestController)
layoutTestController.notifyDone();
}
function main()
{
if (window.layoutTestController) {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
// setTimeout forces execution in the context of the frame
frames[0].setTimeout(test, 0);
}
main();
-->
</script>