1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 21:35:07 +00:00
serenity/Tests/LibWeb/Text/input/XMLHttpRequest-responseXML-empty.html
Andreas Kling 2b343c9508 LibWeb: Don't crash in XHR.response{,XML} for empty XML document
There were some unhandled paths due to the liberally typed XHR response
object. This patch flushes out those issues by using a tighter type set
in the Variant. (NonnullGCPtr<Object> instead of Value)
2023-10-07 10:19:18 +02:00

16 lines
491 B
HTML

<script src="include.js"></script>
<script>
asyncTest((done) => {
const xhr = new XMLHttpRequest();
xhr.responseType = "document";
xhr.open("GET", "data:text/xml,", true);
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
let xml = xhr.responseXML;
println("PASS"); // Didn't crash :^)
done();
}
};
xhr.send();
});
</script>