OLD | NEW |
1 importScripts("../../resources/read-common.js", "../../resources/read-file-test-
cases.js", "worker-read-common.js"); | 1 importScripts("../../resources/read-common.js", "../../resources/read-file-test-
cases.js", "worker-read-common.js"); |
2 | 2 |
| 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]; |
| 13 var tests = {}; |
| 14 for (var i = 0; i < files.length; i++) |
| 15 tests[names[i]] = files[i]; |
| 16 |
| 17 testFiles = tests; |
| 18 } |
| 19 runNextTest(testFiles); |
| 20 }; |
| 21 |
3 function isReadAsAsync() | 22 function isReadAsAsync() |
4 { | 23 { |
5 return true; | 24 return true; |
6 } | 25 } |
7 | |
OLD | NEW |