4 <input type=
"file" name=
"file" id=
"file" onchange=
"onInputFileListChanged()" multiple
>
5 <pre id='console'
></pre>
7 <script src=
"../resources/setup-for-read-common.js"></script>
9 var testFileInfoList
= [
10 { 'name': 'non-existent', 'path': '../resources/non-existent' },
11 { 'name': 'empty-file', 'path': '../resources/empty-file' },
12 { 'name': 'UTF8-file', 'path': '../resources/UTF8.txt' },
13 { 'name': 'UTF16BE-BOM-file', 'path': '../resources/UTF16BE-BOM.txt' },
14 { 'name': 'UTF16LE-BOM-file', 'path': '../resources/UTF16LE-BOM.txt' },
15 { 'name': 'UTF8-BOM-file', 'path': '../resources/UTF8-BOM.txt' },
16 { 'name': 'UTF16BE-file', 'path': '../resources/UTF16BE.txt' },
17 { 'name': 'binary-file', 'path': '../resources/binary-file' },
20 function onInputFileListChanged()
22 var files
= document
.getElementById("file").files
;
23 var namesOnly
= testFileInfoList
.map(function(fileSpec
) { return fileSpec
['name']; });
24 // Send both the FileList and the File names along. Worker will construct
25 // a name => File mapping of the cloned result.
26 startTest([files
, namesOnly
]);
29 function startTest(testFiles
)
31 startWorker(testFiles
, "resources/worker-read-file-async.js");
34 if (window
.eventSender
) {
35 testRunner
.dumpAsText();
36 testRunner
.waitUntilDone();
37 window
.onload = function() { runTests(testFileInfoList
); }