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..7ffe335e504599b85f21a14d0f7bf146df69d5c8 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,25 @@ |
importScripts("../../resources/read-common.js", "../../resources/read-file-test-cases.js", "worker-read-common.js"); |
+onmessage = function(event) { |
+ 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 = {}; |
+ for (var i = 0; i < files.length; i++) |
+ tests[names[i]] = files[i]; |
+ |
+ testFiles = tests; |
+ } |
+ runNextTest(testFiles); |
+}; |
+ |
function isReadAsAsync() |
{ |
return true; |
} |
- |