Tests/LibWeb: Verify XHR.response is an instance of Document
This verifies that XHR.response is an instance of Document when XHR.responseType is set to 'document' and the response contains HTML.
This commit is contained in:
parent
990f73708d
commit
09487679eb
Notes:
sideshowbarker
2024-07-16 20:08:14 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/09487679eb Pull-request: https://github.com/SerenityOS/serenity/pull/22084
2 changed files with 19 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
PASS
|
|
@ -0,0 +1,18 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest((done) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.responseType = "document";
|
||||
xhr.open("GET", "data:text/html,<!DOCTYPE html><html/>", true);
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
if (xhr.response instanceof Document)
|
||||
println("PASS");
|
||||
else
|
||||
println("FAIL");
|
||||
done();
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
});
|
||||
</script>
|
Loading…
Add table
Reference in a new issue