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
Notes:
sideshowbarker
2024-07-17 10:10:18 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/36fddab68e Pull-request: https://github.com/SerenityOS/serenity/pull/22084
2 changed files with 19 additions and 0 deletions
Tests/LibWeb/Text
|
@ -0,0 +1 @@
|
|||
PASS
|
|
@ -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
Reference in a new issue