<!DOCTYPE html>
<html>
<head>
    <script src="/js-test-resources/js-test-pre.js"></script>
</head>
<body>
    <script>
        description('This tests that XMLHttpRequest overrideMimeType() does not update the Content-Type header for the response.');
        window.jsTestIsAsync = true;

        var xhr = new XMLHttpRequest();
        var url = 'resources/reply.xml';

        xhr.onreadystatechange = function () {
            if (xhr.readyState == xhr.LOADING) {
                shouldBe('xhr.getResponseHeader("Content-Type")', '"application/xml"');
                finishJSTest();
            }
        }

        xhr.onerror = function() {
            testFailed('The XHR request to an existing resource failed: "' + url + '"');
            finishJSTest();
        };

        xhr.open('GET', url);
        xhr.overrideMimeType('text/xml;charset=GBK');
        xhr.send();
    </script>
    <script src="/js-test-resources/js-test-post.js"></script>
</body>
</html>
