<!DOCTYPE html>
<html>
<body>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.setHandlesAuthenticationChallenges(true);
    testRunner.setAuthenticationUsername("testUser");
    testRunner.setAuthenticationPassword("testPassword");
    testRunner.waitUntilDone();
}

function receiveMessage(messageEvent) {
    document.getElementById("result").textContent = messageEvent.data;
    if (window.testRunner)
        testRunner.notifyDone();
}

window.addEventListener("message", receiveMessage, false);
</script>
<p>This test opens a new window to a secure page that loads an insecure script that redirects to a secure script guarded by basic authentication. The secure script should be blocked because it requires credentials and was loaded via an insecure redirect.</p>
<div id="result"></div>
<script>
window.open("https://127.0.0.1:8443/security/mixedContent/resources/frame-with-insecure-script-redirects-to-basic-auth-secure-script.html");
</script>
</body>
</html>
