<html>
<body>
<pre id='console'></pre>
<script type="text/javascript">
function log(message)
{
    document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
}

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function processStateChange()
{
    if (xhr.readyState == xhr.DONE) {
        log(xhr.responseText);
        if (window.testRunner)
            testRunner.notifyDone();
    }
}

function errorHandler()
{
    log("FAIL: Network error.");
    if (window.testRunner)
        testRunner.notifyDone();
}

var xhr = new XMLHttpRequest;
xhr.onreadystatechange = processStateChange;
xhr.onerror = errorHandler;

xhr.open("PUT", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-non-get-allow.cgi", true);
xhr.setRequestHeader("Content-Type", "text/plain; charset=UTF-8");
xhr.send("PASS: PUT data received");

</script>
</body>
</html>
