<!DOCTYPE HTML>
<html>
 <head>
    <script src="../../resources/js-test-pre.js"></script>
    <script src="resources/read-common.js"></script>
 </head>
 <body>
    <div id="description"></div>
    <div id="console"></div>
<script>
description("Throw various bad bytes at file reader.");

array = evalAndLog("array = new Uint8Array([65, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 66]);");
blob = evalAndLog("blob = new Blob([array]);");
reader = evalAndLog("reader = new FileReader();");
reader.onload = function(event) {
  fileString = event.target.result;
  shouldBe("fileString", "'A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFDB'");
  finishJSTest();
}
evalAndLog("reader.readAsText(blob);");

var jsTestIsAsync = true;

</script>
    <script src="../../resources/js-test-post.js"></script>
 </body>
</html>
