Tests/LibWeb: Add test for propagation of custom HTTP reason phrase
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

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:
rmg-x 2024-12-05 19:22:15 -06:00 committed by Tim Ledbetter
parent de595b713d
commit fa28337817
Notes: github-actions[bot] 2024-12-06 06:10:33 +00:00
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1 @@
PASS: WHF

View 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>