diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/file/ipc/tests/test_ipcBlob_mixedMultiplex.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/file/ipc/tests/test_ipcBlob_mixedMultiplex.html')
-rw-r--r-- | dom/file/ipc/tests/test_ipcBlob_mixedMultiplex.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/dom/file/ipc/tests/test_ipcBlob_mixedMultiplex.html b/dom/file/ipc/tests/test_ipcBlob_mixedMultiplex.html new file mode 100644 index 0000000000..c8e046fa88 --- /dev/null +++ b/dom/file/ipc/tests/test_ipcBlob_mixedMultiplex.html @@ -0,0 +1,41 @@ +<!DOCTYPE HTML> +<html> +<head> + <title>Test an empty IPCBlob together with other parts</title> + <script type="text/javascript" src="/MochiKit/MochiKit.js"></script> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> +</head> +<body> +<script type="text/javascript"> + +let url = SimpleTest.getTestFileURL("script_file.js"); +let data = new Array(1024*1024).join('A'); + +let script = SpecialPowers.loadChromeScript(url); +script.addMessageListener("file.opened", message => { + let blob = new Blob([data]); + + let form = new FormData(); + form.append("blob1", blob); + form.append("blob2", message.file); + form.append("blob3", blob); + + fetch("ok.sjs", { + method: "POST", + body: form, + }) + .then(r => r.text()) + .then(r => { + ok(parseInt(r, 10) > (data.length * 2), "We have data"); + }) + . then(SimpleTest.finish); +}); + +script.sendAsyncMessage("file.open"); +SimpleTest.waitForExplicitFinish(); + +</script> +</pre> +</body> +</html> |