Revision d0d62244432d329aa22e9278d3e83184301c3e7f authored by Chris Nardi on 07 April 2018, 01:36:26 UTC, committed by Xidorn Quan on 07 April 2018, 02:05:46 UTC
See https://github.com/w3c/csswg-drafts/issues/2509#issuecomment-379152590 for the change to target9. Also remove the extra whitespace in target8 and target1 which causes these tests to fail in Chrome and Firefox. Also remove testcase.propertyName from each test's name as this doesn't exist and just outputs undefined.
1 parent 6e68c44
fileReader.html
<!doctype html>
<html>
<head>
<title>FileReader States</title>
<link rel=help href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-filereader">
<link rel=author title="Lenient" href="mailto:lenient315@gmail.com">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
test(function() {
assert_true("FileReader" in window, "window should have a FileReader property.");
}, "FileReader interface object");
test(function(){
var fileReader = new FileReader();
assert_true(fileReader instanceof FileReader);
}, "no-argument FileReader constructor");
var t_abort = async_test("FileReader States -- abort");
t_abort.step(function(){
var fileReader = new FileReader();
assert_equals(fileReader.readyState, 0);
assert_equals(fileReader.readyState, FileReader.EMPTY);
var blob = new Blob();
fileReader.readAsArrayBuffer(blob);
assert_equals(fileReader.readyState, 1);
assert_equals(fileReader.readyState, FileReader.LOADING);
fileReader.onabort = this.step_func(function(e) {
assert_equals(fileReader.readyState, 2);
assert_equals(fileReader.readyState, FileReader.DONE);
t_abort.done();
});
fileReader.abort();
fileReader.onabort = this.unreached_func("abort event should fire sync")
});
var t_event = async_test("FileReader States -- events");
t_event.step(function(){
var fileReader = new FileReader();
var blob = new Blob();
fileReader.readAsArrayBuffer(blob);
fileReader.onloadstart = this.step_func(function(e) {
assert_equals(fileReader.readyState, 1);
assert_equals(fileReader.readyState, FileReader.LOADING);
});
fileReader.onprogress = this.step_func(function(e) {
assert_equals(fileReader.readyState, 1);
assert_equals(fileReader.readyState, FileReader.LOADING);
});
fileReader.onloadend = this.step_func(function(e) {
assert_equals(fileReader.readyState, 2);
assert_equals(fileReader.readyState, FileReader.DONE);
t_event.done();
});
});
</script>
</body>
</html>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...