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

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

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/worker-read-file-async.html
diff --git a/LayoutTests/fast/files/workers/worker-read-file-async.html b/LayoutTests/fast/files/workers/worker-read-file-async.html
index 5c52cb13fc91a66a3d137bc614d29c4954c007d7..39a441bd2e23fe733f2a57d3f736670ec0ee35ab 100644
--- a/LayoutTests/fast/files/workers/worker-read-file-async.html
+++ b/LayoutTests/fast/files/workers/worker-read-file-async.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<body>
-<input type="file" name="file" id="file" onchange="onInputFileChange(testFileInfoList)" multiple>
+<input type="file" name="file" id="file" onchange="onInputFileListChanged()" multiple>
<pre id='console'></pre>
<script src="../resources/setup-for-read-common.js"></script>
@@ -17,6 +17,15 @@ var testFileInfoList = [
{ 'name': 'binary-file', 'path': '../resources/binary-file' },
];
+function onInputFileListChanged()
+{
+ var files = document.getElementById("file").files;
+ var namesOnly = testFileInfoList.map(function(fileSpec) { return fileSpec['name']; });
+ // Send both the FileList and the File names along. Worker will construct
+ // a name => File mapping of the cloned result.
+ startTest([files, namesOnly]);
+}
+
function startTest(testFiles)
{
startWorker(testFiles, "resources/worker-read-file-async.js");

Powered by Google App Engine
This is Rietveld 408576698