mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02: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:
committed by
Andrew Kaster
parent
0b64a71603
commit
0f168d9ca2
Notes:
sideshowbarker
2024-07-17 08:43:11 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/0f168d9ca2 Pull-request: https://github.com/SerenityOS/serenity/pull/23323 Reviewed-by: https://github.com/ADKaster ✅
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user