Newer
Older
minerva / Tests / LibWeb / Text / input / XHR / XMLHttpRequest-response-is-arraybuffer.html
@minerva minerva on 13 Jul 575 bytes Initial commit
<script src="../include.js"></script>
<script>
    asyncTest((done) => {
        const xhr = new XMLHttpRequest();
        xhr.responseType = "arraybuffer";
        xhr.onreadystatechange = async function() {
            if (xhr.readyState === 4 && xhr.status === 200) {
                if (xhr.response instanceof ArrayBuffer)
                    println("PASS");
                else
                    println("FAIL");
                done();
            }
        };
        xhr.open("GET", "data:text/plain,Hello%20World!", true);
        xhr.send();
    });
</script>