mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:38:13 +00:00
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().
This commit is contained in:
parent
7a0191cbe9
commit
ac82585ae7
2 changed files with 15 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
PASS
|
|
@ -0,0 +1,14 @@
|
|||
<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>
|
Loading…
Add table
Add a link
Reference in a new issue