1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:07:34 +00:00

Tests/LibWeb: Verify XHR.send() throws when called twice

This verifies that XHR.send() throws an Invalid State Error when called
twice.
This commit is contained in:
Kenneth Myhra 2023-11-25 14:47:08 +01:00 committed by Andreas Kling
parent ac82585ae7
commit ff05f19c84
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,16 @@
<script src="../include.js"></script>
<script>
test(() => {
const INVALID_STATE_ERR = 11;
try {
const xhr = new XMLHttpRequest();
xhr.open("GET", "data:text/plain,", true);
xhr.send();
xhr.send();
}
catch (e) {
if (e.code === INVALID_STATE_ERR)
println("PASS");
}
});
</script>