Tests/LibWeb: Move existing Fetch tests in under the Fetch folder

This commit is contained in:
Kenneth Myhra 2024-07-22 14:01:35 +02:00 committed by Andreas Kling
commit 92f6336fe8
Notes: github-actions[bot] 2024-07-23 07:03:29 +00:00
6 changed files with 3 additions and 3 deletions

View file

@ -0,0 +1,16 @@
<script src="../include.js"></script>
<script type="text/javascript">
asyncTest(async done => {
const body = new URLSearchParams();
body.append("username", "buggie");
body.append("password", "hunter2");
const request = new Request("fetch-url-search-params.html", {
method: "POST",
body: body,
});
println(await request.text());
done();
});
</script>

View file

@ -0,0 +1,18 @@
<script src="../include.js"></script>
<script>
test(() => {
const data = ["<h1>Well hello friends!</h1>"];
const blob = new Blob(data, { type: "text/html" });
const response1 = new Response(blob);
const response2 = new Response(blob, {
headers: {
"Content-Type": "text/plain",
},
});
println(response1.headers.get("Content-Type"));
println(response2.headers.get("Content-Type"));
});
</script>

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(async done => {
try {
await fetch("about:srcdoc", { signal: AbortSignal.timeout(0) });
} finally {
println("PASS (didn't crash)");
done();
}
});
</script>