1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 20:05:07 +00:00

Tests/LibWeb: Initialize Blob with string and read it from arrayBuffer()

This commit is contained in:
Kenneth Myhra 2023-12-03 18:51:09 +01:00 committed by Andreas Kling
parent b72489409a
commit d9fb116bcc
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,13 @@
<script src="../include.js"></script>
<script>
asyncTest(async (done) => {
const blob = new Blob(["This is some data to be read! 🦬"]);
const arrayBuffer = await blob.arrayBuffer();
const string = new TextDecoder().decode(new Uint8Array(arrayBuffer));
if (string === "This is some data to be read! 🦬")
println("PASS");
else
println("FAIL");
done();
});
</script>