LibWeb: Add test for computed mimetypes in loaded documents

This couldn't be added in #2207
This commit is contained in:
Gingeh 2024-12-06 14:14:36 +11:00 committed by Tim Ledbetter
parent e4512d8089
commit c937aff95a
Notes: github-actions[bot] 2024-12-06 04:49:22 +00:00
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1 @@
PASS: UTF-8

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<script src="include.js"></script>
<script>
asyncTest(async (done) => {
const httpServer = httpTestServer();
const url = await httpServer.createEcho("GET", "/document-computed-mimetype-test", {
status: 200,
headers: {
"Access-Control-Allow-Origin": "*",
},
body: `<!doctype html><meta charset="UTF-8"><script>parent.postMessage(document.characterSet, "*")<\/script>`,
});
const frame = document.createElement('iframe');
frame.src = url;
addEventListener("message", (event) => {
println("PASS: " + event.data);
done();
}, false);
document.body.appendChild(frame);
});
</script>