Tests/LibWeb: Verify XHR.response is an instance of Blob

This verifies that XHR.response is an instance of Blob when
XHR.responseType is set to 'blob'.
This commit is contained in:
Kenneth Myhra 2023-11-28 20:09:37 +01:00 committed by Andreas Kling
parent 09487679eb
commit 36fddab68e
Notes: sideshowbarker 2024-07-17 10:10:18 +09:00
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1 @@
PASS

View file

@ -0,0 +1,18 @@
<script src="../include.js"></script>
<script>
asyncTest((done) => {
const xhr = new XMLHttpRequest();
xhr.responseType = "blob";
xhr.onreadystatechange = async function() {
if (xhr.readyState === 4 && xhr.status === 200) {
if (xhr.response instanceof Blob)
println("PASS");
else
println("FAIL");
done();
}
};
xhr.open("GET", "data:text/plain,Hello%20World!", true);
xhr.send();
});
</script>