11cb0ef41Sopenharmony_ci<!DOCTYPE html>
21cb0ef41Sopenharmony_ci<html>
31cb0ef41Sopenharmony_ci  <head>
41cb0ef41Sopenharmony_ci    <meta charset="utf-8">
51cb0ef41Sopenharmony_ci    <title>FileAPI Test: filereader_readAsArrayBuffer</title>
61cb0ef41Sopenharmony_ci    <link rel="author" title="Intel" href="http://www.intel.com">
71cb0ef41Sopenharmony_ci    <link rel="help" href="http://dev.w3.org/2006/webapi/FileAPI/#readAsArrayBuffer">
81cb0ef41Sopenharmony_ci    <script src="/resources/testharness.js"></script>
91cb0ef41Sopenharmony_ci    <script src="/resources/testharnessreport.js"></script>
101cb0ef41Sopenharmony_ci  </head>
111cb0ef41Sopenharmony_ci  <body>
121cb0ef41Sopenharmony_ci    <div id="log"></div>
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ci    <script>
151cb0ef41Sopenharmony_ci    async_test(function() {
161cb0ef41Sopenharmony_ci      var blob = new Blob(["TEST"]);
171cb0ef41Sopenharmony_ci      var reader = new FileReader();
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ci      reader.onload = this.step_func(function(evt) {
201cb0ef41Sopenharmony_ci        assert_equals(reader.result.byteLength, 4, "The byteLength is 4");
211cb0ef41Sopenharmony_ci        assert_true(reader.result instanceof ArrayBuffer, "The result is instanceof ArrayBuffer");
221cb0ef41Sopenharmony_ci        assert_equals(reader.readyState, reader.DONE);
231cb0ef41Sopenharmony_ci        this.done();
241cb0ef41Sopenharmony_ci      });
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_ci      reader.onloadstart = this.step_func(function(evt) {
271cb0ef41Sopenharmony_ci        assert_equals(reader.readyState, reader.LOADING);
281cb0ef41Sopenharmony_ci      });
291cb0ef41Sopenharmony_ci
301cb0ef41Sopenharmony_ci      reader.onprogress = this.step_func(function(evt) {
311cb0ef41Sopenharmony_ci        assert_equals(reader.readyState, reader.LOADING);
321cb0ef41Sopenharmony_ci      });
331cb0ef41Sopenharmony_ci
341cb0ef41Sopenharmony_ci      reader.readAsArrayBuffer(blob);
351cb0ef41Sopenharmony_ci    });
361cb0ef41Sopenharmony_ci    </script>
371cb0ef41Sopenharmony_ci  </body>
381cb0ef41Sopenharmony_ci</html>
39