mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +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:
parent
ac82585ae7
commit
ff05f19c84
2 changed files with 17 additions and 0 deletions
|
@ -0,0 +1 @@
|
||||||
|
PASS
|
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue