1 importScripts("../../resources/read-common.js", "../../resources/read-file-test-cases.js", "worker-read-common.js");
3 onmessage = function(event) {
4 var testFiles = event.data;
5 log("Received files in worker");
6 if (event.data[0] instanceof FileList) {
7 log("Received a FileList");
8 // The tests expects a name => File map; construct the
9 // mapping from the FileList and the test names that
10 // were posted (as a pair, using an Array.)
11 var files = event.data[0];
12 var names = event.data[1];
14 for (var i = 0; i < files.length; i++)
15 tests[names[i]] = files[i];
19 runNextTest(testFiles);
22 function isReadAsAsync()