mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-04 16:11:54 +00:00
This commit adds an in-tree test for code added in a previous commit:
e89e084798
We want to make sure that the custom reason phrase is making it from
RequestServer to the "statusText" property in the XHR infrastructure.
27 lines
789 B
HTML
27 lines
789 B
HTML
<script src="./include.js"></script>
|
|
<script>
|
|
asyncTest(async (done) => {
|
|
const expectedStatusText = "WHF";
|
|
|
|
try {
|
|
const httpServer = httpTestServer();
|
|
const url = await httpServer.createEcho("GET", "/http-reason-phrase-test", {
|
|
status: 200,
|
|
reason_phrase: expectedStatusText,
|
|
headers: {
|
|
"Access-Control-Allow-Origin": "*",
|
|
},
|
|
});
|
|
|
|
const result = await fetch(url);
|
|
const statusText = result.statusText;
|
|
|
|
if (statusText === expectedStatusText) {
|
|
println(`PASS: ${statusText}`);
|
|
}
|
|
} catch (err) {
|
|
println("FAIL - " + err);
|
|
}
|
|
done();
|
|
});
|
|
</script>
|