mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
PR-URL: https://github.com/nodejs/node/pull/36811 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
16 lines
548 B
JavaScript
16 lines
548 B
JavaScript
importScripts("/resources/testharness.js");
|
|
|
|
async_test(function() {
|
|
var file = new File(["bits"], "dummy", { 'type': 'text/plain', lastModified: 42 });
|
|
var reader = new FileReader();
|
|
reader.onload = this.step_func_done(function() {
|
|
assert_equals(file.name, "dummy", "file name");
|
|
assert_equals(reader.result, "bits", "file content");
|
|
assert_equals(file.lastModified, 42, "file lastModified");
|
|
});
|
|
reader.onerror = this.unreached_func("Unexpected error event");
|
|
reader.readAsText(file);
|
|
}, "FileReader in Worker");
|
|
|
|
done();
|