1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:27:42 +00:00

Tests/LibWeb: Add test to prove we can {,de}serialize File

This test proves the ability of structuredClone() to serialize and
deserialize a File object.
This commit is contained in:
Kenneth Myhra 2024-02-23 22:15:19 +01:00 committed by Andrew Kaster
parent 0b64a71603
commit 0f168d9ca2
2 changed files with 13 additions and 0 deletions

View file

@ -7,6 +7,14 @@
let text = await blob.text();
println(`Blob.text(): ${text}`);
let file = structuredClone(new File(["Hello, File!"], "hello.txt", {type: "text/plain"}));
println(`instanceOf File: ${file instanceof File}`);
println(`File.name: ${file.name}`);
println(`File.type: ${file.type}`);
text = await file.text();
println(`File.text(): ${text}`);
println(`File.size: ${file.size}`);
done();
});
</script>