diff options
Diffstat (limited to 'dom/workers/test/fileSubWorker_worker.js')
-rw-r--r-- | dom/workers/test/fileSubWorker_worker.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/dom/workers/test/fileSubWorker_worker.js b/dom/workers/test/fileSubWorker_worker.js new file mode 100644 index 000000000..21fbc3454 --- /dev/null +++ b/dom/workers/test/fileSubWorker_worker.js @@ -0,0 +1,17 @@ +/** + * Expects a file. Returns an object containing the size, type, name and path + * using another worker. Used to test posting of file from worker to worker. + */ +onmessage = function(event) { + var worker = new Worker("file_worker.js"); + + worker.postMessage(event.data); + + worker.onmessage = function(event) { + postMessage(event.data); + } + + worker.onerror = function(event) { + postMessage(undefined); + } +}; |