blob: c04150e06862a7cdaabfac77fefb120a073eda40 [file] [log] [blame]
<iframe src="http://does.not.exist/" id="target"></iframe>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
if (testRunner.setShouldDecideNavigationPolicyAfterDelay)
testRunner.setShouldDecideNavigationPolicyAfterDelay(true);
}
let frame = document.getElementById("target");
frame.contentWindow.onbeforeunload = function() {
setTimeout(function() {
frame.src = "javascript:alert('FAIL')";
}, 0);
};
window.addEventListener("load", function() {
document.write("PASS - Javascript URL blocked without crashing.");
if (window.testRunner)
testRunner.notifyDone();
}, false);
</script>