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

This test proves the ability of structuredClone() to serialize and
deserialize a Blob object.
This commit is contained in:
Kenneth Myhra 2024-02-23 18:33:49 +01:00 committed by Andrew Kaster
parent 27445f3132
commit 44e5c62545
Notes: sideshowbarker 2024-07-18 02:47:59 +09:00
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,12 @@
<script src="../include.js"></script>
<script>
asyncTest(async done => {
let blob = structuredClone(new Blob(["Hello, Blob!"], {type: "text/plain"}));
println(`instanceOf Blob: ${blob instanceof Blob}`);
println(`Blob.type: ${blob.type}`);
let text = await blob.text();
println(`Blob.text(): ${text}`);
done();
});
</script>