Skip to content

Commit ff05f19

Browse files
kennethmyhraawesomekling
authored andcommitted
Tests/LibWeb: Verify XHR.send() throws when called twice
This verifies that XHR.send() throws an Invalid State Error when called twice.
1 parent ac82585 commit ff05f19

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PASS
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<script src="../include.js"></script>
2+
<script>
3+
test(() => {
4+
const INVALID_STATE_ERR = 11;
5+
try {
6+
const xhr = new XMLHttpRequest();
7+
xhr.open("GET", "data:text/plain,", true);
8+
xhr.send();
9+
xhr.send();
10+
}
11+
catch (e) {
12+
if (e.code === INVALID_STATE_ERR)
13+
println("PASS");
14+
}
15+
});
16+
</script>

0 commit comments

Comments
 (0)