Files
ladybird/Tests/LibWeb/Text/input/XHR/XMLHttpRequest-network-error-message.html
Shannon Booth 093ad69f5b Tests/LibWeb: Do not hardcode URL path for echo server tests
Instead, use the URL used by the echo server.
2026-03-23 22:32:43 +01:00

24 lines
577 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(async (done) => {
const server = httpTestServer();
const url = await server.createEcho("GET", "/close-connection", {
status: 0,
close_connection: true,
});
const xhr = new XMLHttpRequest();
xhr.open("GET", url, false);
try {
xhr.send();
println("FAIL: no exception thrown");
} catch (e) {
println(e.name);
println(e.message);
}
done();
});
</script>