4 <title>FileReader readyState
</title>
5 <link rel=
"help" href=
"http://www.w3.org/TR/FileAPI/#events">
6 <script src=
"../../resources/testharness.js"></script>
7 <script src=
"../../resources/testharnessreport.js"></script>
12 var reader
= new FileReader();
14 setup({explicit_done
: true});
17 assert_equals(reader
.readyState
, reader
.EMPTY
, "The readyState");
18 }, "Check if the readyState is EMPTY initially");
20 on_event(reader
, "loadstart", function() {
22 assert_equals(reader
.readyState
, reader
.LOADING
, "The readyState");
23 }, "Check if the readyState is LOADING in loadstart");
26 on_event(reader
, "progress", function() {
28 assert_equals(reader
.readyState
, reader
.LOADING
, "The readyState");
29 }, "Check if the readyState is LOADING in progress");
32 on_event(reader
, "load", function() {
34 assert_equals(reader
.readyState
, reader
.DONE
, "The readyState");
35 }, "Check if the readyState is DONE in load");
38 on_event(reader
, "loadend", function() {
40 assert_equals(reader
.readyState
, reader
.DONE
, "The readyState");
41 }, "Check if the readyState is DONE in loadend");
46 reader
.readAsText(new Blob(["foo"]));