mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
LibWeb: Add test for computed mimetypes in loaded documents
This couldn't be added in #2207
This commit is contained in:
parent
e4512d8089
commit
c937aff95a
Notes:
github-actions[bot]
2024-12-06 04:49:22 +00:00
Author: https://github.com/Gingeh Commit: https://github.com/LadybirdBrowser/ladybird/commit/c937aff95a6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2805 Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 25 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
PASS: UTF-8
|
24
Tests/LibWeb/Text/input/document-computed-mimetype.html
Normal file
24
Tests/LibWeb/Text/input/document-computed-mimetype.html
Normal 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>
|
Loading…
Reference in a new issue