From 7194843a04d8971b83c146695e6d66ffdcf786e4 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Tue, 20 Nov 2018 18:08:34 +0100 Subject: [PATCH] Bug 1507893 - Fetch() should consume DOM Files on the target thread only - test, r=twisniewski --- dom/file/tests/mochitest.ini | 2 + dom/file/tests/test_bug1507893.html | 63 +++++++++++++++++++++++++++++ dom/file/tests/worker_bug1507893.js | 5 +++ 3 files changed, 70 insertions(+) create mode 100644 dom/file/tests/test_bug1507893.html create mode 100644 dom/file/tests/worker_bug1507893.js diff --git a/dom/file/tests/mochitest.ini b/dom/file/tests/mochitest.ini index c1f7f7d30283..c5fe363661ac 100644 --- a/dom/file/tests/mochitest.ini +++ b/dom/file/tests/mochitest.ini @@ -43,3 +43,5 @@ skip-if = (toolkit == 'android') # Android: Bug 775227 skip-if = (toolkit == 'android') # Android: Bug 775227 [test_mozfiledataurl.html] skip-if = toolkit == 'android' #TIMED_OUT +[test_bug1507893.html] +support-files = worker_bug1507893.js diff --git a/dom/file/tests/test_bug1507893.html b/dom/file/tests/test_bug1507893.html new file mode 100644 index 000000000000..b5a49faba926 --- /dev/null +++ b/dom/file/tests/test_bug1507893.html @@ -0,0 +1,63 @@ + + + + + Blob URLs fetched in workers + + + + + + + diff --git a/dom/file/tests/worker_bug1507893.js b/dom/file/tests/worker_bug1507893.js new file mode 100644 index 000000000000..2ab0d06b43ef --- /dev/null +++ b/dom/file/tests/worker_bug1507893.js @@ -0,0 +1,5 @@ +onmessage = e => { + fetch(e.data) + .then(r => r.blob()) + .then(blob => postMessage(blob)); +}