Bug 1507064 [wpt PR 14046] - Implement RTCQuicStream.waitForWriteBufferedAmountBelow(), a=testonly
☠☠ backed out by 46ad93280b06 ☠ ☠
authorSteve Anton <steveanton@chromium.org>
Mon, 19 Nov 2018 18:45:54 +0000
changeset 503739 d76dc6e3bbaae980868c087c608c185265142618
parent 503738 30d8f48aab9914f1eabb852a165d6c87fa4fd327
child 503740 bcb5a5eebc6cfd4489490c7d3a9af18a668b749f
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1507064, 14046, 874296, 1286902, 608648
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507064 [wpt PR 14046] - Implement RTCQuicStream.waitForWriteBufferedAmountBelow(), a=testonly Automatic update from web-platform-testsImplement RTCQuicStream.waitForWriteBufferedAmountBelow() Bug: 874296 Change-Id: I694325a0cc85ad520c18762e34ba05e2204e2c74 Reviewed-on: https://chromium-review.googlesource.com/c/1286902 Commit-Queue: Steve Anton <steveanton@chromium.org> Reviewed-by: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#608648} -- wpt-commits: d84cf823ac8a9bee7df5be37f4fafdbe218ab6a7 wpt-pr: 14046
testing/web-platform/tests/webrtc/RTCQuicStream.https.html
--- a/testing/web-platform/tests/webrtc/RTCQuicStream.https.html
+++ b/testing/web-platform/tests/webrtc/RTCQuicStream.https.html
@@ -248,9 +248,58 @@ promise_test(async t => {
   const [ localQuicTransport, remoteQuicTransport ] =
       await makeTwoConnectedQuicTransports(t);
   const localStream = localQuicTransport.createStream();
   localStream.write(new Uint8Array(10));
   localStream.finish();
   assert_equals(localStream.writeBufferedAmount, 10);
 }, 'writeBufferedAmount maintained after finish() has been called.');
 
+promise_test(async t => {
+  const [ localQuicTransport, remoteQuicTransport ] =
+      await makeTwoConnectedQuicTransports(t);
+  const localStream = localQuicTransport.createStream();
+  await localStream.waitForWriteBufferedAmountBelow(0);
+}, 'waitForWriteBufferedAmountBelow(0) resolves immediately.');
+
+promise_test(async t => {
+  const [ localQuicTransport, remoteQuicTransport ] =
+      await makeTwoConnectedQuicTransports(t);
+  const localStream = localQuicTransport.createStream();
+  await localStream.waitForWriteBufferedAmountBelow(
+      localStream.maxWriteBufferedAmount);
+}, 'waitForWriteBufferedAmountBelow(maxWriteBufferedAmount) resolves ' +
+  'immediately.');
+
+promise_test(async t => {
+  const [ localQuicTransport, remoteQuicTransport ] =
+      await makeTwoConnectedQuicTransports(t);
+  const localStream = localQuicTransport.createStream();
+  localStream.write(new Uint8Array(localStream.maxWriteBufferedAmount));
+  const promise1 = localStream.waitForWriteBufferedAmountBelow(0);
+  const promise2 = localStream.waitForWriteBufferedAmountBelow(0);
+  localStream.finish();
+  await Promise.all([
+      promise_rejects(t, 'InvalidStateError', promise1),
+      promise_rejects(t, 'InvalidStateError', promise2)]);
+}, 'Pending waitForWriteBufferedAmountBelow() promises rejected after ' +
+  'finish().');
+
+promise_test(async t => {
+  const [ localQuicTransport, remoteQuicTransport ] =
+      await makeTwoConnectedQuicTransports(t);
+  const localStream = localQuicTransport.createStream();
+  localStream.write(new Uint8Array(localStream.maxWriteBufferedAmount));
+  const promise1 = localStream.waitForWriteBufferedAmountBelow(0);
+  const promise2 = localStream.waitForWriteBufferedAmountBelow(0);
+  localStream.reset();
+  await Promise.all([
+      promise_rejects(t, 'InvalidStateError', promise1),
+      promise_rejects(t, 'InvalidStateError', promise2)]);
+}, 'Pending waitForWriteBufferedAmountBelow() promises rejected after ' +
+  'reset().');
+
+closed_stream_test(async (t, stream) => {
+  await promise_rejects(t, 'InvalidStateError',
+      stream.waitForWriteBufferedAmountBelow(0));
+}, 'waitForWriteBufferedBelow() rejects with InvalidStateError.');
+
 </script>