2 Any copyright is dedicated to the Public Domain.
3 http://creativecommons.org/publicdomain/zero/1.0/
8 <title>Test for bug
1317725</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
14 <input type=
"file" id=
"file" />
16 <script class=
"testbody" type=
"text/javascript">
18 SimpleTest.waitForExplicitFinish();
20 var url = SimpleTest.getTestFileURL(
"script_createFile.js");
21 script = SpecialPowers.loadChromeScript(url);
23 function onOpened(message) {
24 var input = document.getElementById('file');
25 SpecialPowers.wrap(input).mozSetFileArray([message.data]);
27 var worker = new Worker(
"test_bug1317725.js");
28 worker.onerror = function(e) {
29 ok(false,
"We should not see any error.");
33 worker.onmessage = function(e) {
34 ok(e.data,
"Everything seems OK on the worker-side.");
38 is(input.files.length,
1,
"We have something");
39 ok(input.files[
0] instanceof Blob,
"We have one Blob");
40 worker.postMessage(input.files[
0]);
43 script.addMessageListener(
"file.opened", onOpened);
44 script.sendAsyncMessage(
"file.open");