Index: LayoutTests/fast/files/workers/resources/worker-read-file-async.js |
diff --git a/LayoutTests/fast/files/workers/resources/worker-read-file-async.js b/LayoutTests/fast/files/workers/resources/worker-read-file-async.js |
index 3271e08cc4f2980398e42626464da94f1eba5646..4d3d87b25b78517ca704d37b793fab7327cce463 100644 |
--- a/LayoutTests/fast/files/workers/resources/worker-read-file-async.js |
+++ b/LayoutTests/fast/files/workers/resources/worker-read-file-async.js |
@@ -1,7 +1,27 @@ |
importScripts("../../resources/read-common.js", "../../resources/read-file-test-cases.js", "worker-read-common.js"); |
+onmessage = function(event) |
+{ |
jsbell
2014/07/01 16:37:18
Nit: place this on the same line as the function()
|
+ var testFiles = event.data; |
+ log("Received files in worker"); |
+ if (event.data[0] instanceof FileList) { |
+ log("Received a FileList"); |
+ // The tests expects a name => File map; construct the |
+ // mapping from the FileList and the test names that |
+ // were posted (as a pair, using an Array.) |
+ var files = event.data[0]; |
+ var names = event.data[1]; |
+ var tests = { }; |
jsbell
2014/07/01 16:37:18
We seem to more consistently write {}
|
+ for (var i = 0; i < files.length; i++) { |
jsbell
2014/07/01 16:37:18
Note: Can optionally skip the brace for a single l
|
+ tests[names[i]] = files[i]; |
+ } |
+ |
+ testFiles = tests; |
+ } |
+ runNextTest(testFiles); |
+} |
jsbell
2014/07/01 16:37:18
Nit: ; after assignment statement
|
+ |
function isReadAsAsync() |
{ |
return true; |
} |
- |