mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 10:37:17 +02:00
Tests/LibWeb: Verify XHR.response is an instance of ArrayBuffer
This verifies that XHR.response is an instance of ArrayBuffer when XHR.responseType is set to 'arraybuffer'.
This commit is contained in:
committed by
Andreas Kling
parent
68fa8f52b4
commit
990f73708d
Notes:
sideshowbarker
2024-07-17 08:25:15 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/990f73708d Pull-request: https://github.com/SerenityOS/serenity/pull/22084
@@ -0,0 +1,18 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user