Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: LayoutTests/fast/files/workers/resources/worker-read-file-async.js

Issue 349633005: Expose FileList in Worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test improvements Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
-

Powered by Google App Engine
This is Rietveld 408576698