diff options
Diffstat (limited to 'testing/web-platform/tests/workers/Worker-formdata.any.js')
-rw-r--r-- | testing/web-platform/tests/workers/Worker-formdata.any.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/web-platform/tests/workers/Worker-formdata.any.js b/testing/web-platform/tests/workers/Worker-formdata.any.js new file mode 100644 index 0000000000..a07f194bd2 --- /dev/null +++ b/testing/web-platform/tests/workers/Worker-formdata.any.js @@ -0,0 +1,19 @@ +// META: global=dedicatedworker +test(() => { + assert_own_property(self, 'FormData'); + assert_equals(FormData.length, 0); + + var formData = new FormData(); + assert_not_equals(formData, null); + assert_own_property(FormData.prototype, 'append'); + formData.append('key', 'value'); + + var blob = new Blob([]); + assert_not_equals(blob, null); + formData.append('key', blob); + formData.append('key', blob, 'filename'); + + assert_throws_dom("DataCloneError", + function() { postMessage(formData) }, + "Trying to clone formdata inside a postMessage results in an exception." ); +},'Test FormData interface object'); |