summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webtransport/sendstream-bad-chunk.https.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/webtransport/sendstream-bad-chunk.https.any.js')
-rw-r--r--testing/web-platform/tests/webtransport/sendstream-bad-chunk.https.any.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webtransport/sendstream-bad-chunk.https.any.js b/testing/web-platform/tests/webtransport/sendstream-bad-chunk.https.any.js
new file mode 100644
index 0000000000..013390879b
--- /dev/null
+++ b/testing/web-platform/tests/webtransport/sendstream-bad-chunk.https.any.js
@@ -0,0 +1,18 @@
+// META: global=window,worker
+// META: script=/common/get-host-info.sub.js
+// META: script=resources/webtransport-test-helpers.sub.js
+// META: script=/common/utils.js
+
+promise_test(async t => {
+ // Establish a WebTransport session.
+ const wt = new WebTransport(webtransport_url('echo.py'));
+ t.add_cleanup(() => wt.close());
+ await wt.ready;
+
+ // Create a bidirectional stream
+ const {writable} = await wt.createBidirectionalStream();
+
+ const writer = writable.getWriter();
+ await promise_rejects_js(t, TypeError, writer.write("foo"));
+ await promise_rejects_js(t, TypeError, writer.write(new Uint8Array(0)));
+}, 'WebTransportSendStream should reject when non-buffer-source data is written');