1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 19:05:07 +00:00
serenity/Tests/LibWeb/Text/input/XHR/XMLHttpRequest-send-flag-already-set.html
Kenneth Myhra ff05f19c84 Tests/LibWeb: Verify XHR.send() throws when called twice
This verifies that XHR.send() throws an Invalid State Error when called
twice.
2023-11-29 21:51:35 +01:00

16 lines
402 B
HTML

<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>