mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:48:14 +00:00
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:
parent
09487679eb
commit
36fddab68e
2 changed files with 19 additions and 0 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue