1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 16:15:08 +00:00
serenity/Tests/LibWeb/Text/input/XHR/XMLHttpRequest-state-not-opened.html
Kenneth Myhra ac82585ae7 Tests/LibWeb: Verify XHR.send() throws when XHR.readyState is UNSENT
This verifies that an Invalid State Error is being thrown when
XHR.open() has not been called before calling XHR::send().
2023-11-29 21:51:35 +01:00

14 lines
323 B
HTML

<script src="../include.js"></script>
<script>
test(() => {
const INVALID_STATE_ERR = 11;
try {
const xhr = new XMLHttpRequest();
xhr.send();
}
catch (e) {
if (e.code === INVALID_STATE_ERR)
println("PASS");
}
});
</script>