Blob-intialized-with-strings-read-from-arrayBuffer.html 448 B

12345678910111213
  1. <script src="../include.js"></script>
  2. <script>
  3. asyncTest(async (done) => {
  4. const blob = new Blob(["This is some data to be read! 🦬"]);
  5. const arrayBuffer = await blob.arrayBuffer();
  6. const string = new TextDecoder().decode(new Uint8Array(arrayBuffer));
  7. if (string === "This is some data to be read! 🦬")
  8. println("PASS");
  9. else
  10. println("FAIL");
  11. done();
  12. });
  13. </script>