mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
Tests/LibWeb: Add test for propagation of custom HTTP reason phrase
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.
This commit is contained in:
Notes:
github-actions[bot]
2024-12-06 06:10:33 +00:00
Author: https://github.com/rmg-x Commit: https://github.com/LadybirdBrowser/ladybird/commit/fa283378175 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2802 Reviewed-by: https://github.com/tcl3 ✅
@@ -0,0 +1 @@
|
||||
PASS: WHF
|
||||
27
Tests/LibWeb/Text/input/http-reason-phrase-propagation.html
Normal file
27
Tests/LibWeb/Text/input/http-reason-phrase-propagation.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user