mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02: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:
committed by
Andreas Kling
parent
7a0191cbe9
commit
ac82585ae7
Notes:
sideshowbarker
2024-07-17 17:40:13 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/ac82585ae7 Pull-request: https://github.com/SerenityOS/serenity/pull/22084
@@ -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>
|
||||
Reference in New Issue
Block a user