<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<script>
    description("Tests that URL-based username and password are not revealed in location.href.");

    window.jsTestIsAsync = true;

    var frame = document.createElement('iframe');
    frame.setAttribute('src', 'http://_username:_password@' 
        + location.host + '/security/resources/blank.html');

    document.body.appendChild(frame);

    frame.onload = function() {
        var href = frame.contentWindow.location.href;
        if (href.indexOf('_username') === -1 &&
            href.indexOf('_password') === -1) {
            testPassed("No username or password in location.href.");
        } else {
            testFailed("Either username, password, or both were found in location.href");
        }
        
        finishJSTest();
    };
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>
