mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 19:46:03 +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
Notes:
sideshowbarker
2024-07-16 18:26:46 +09:00
Author: https://github.com/kennethmyhra
Commit: ff05f19c84
Pull-request: https://github.com/SerenityOS/serenity/pull/22084
2 changed files with 17 additions and 0 deletions
|
@ -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