Handle closing pending streams.

Make QuicSession handle if a pending stream is closed before it gets converted
into the appropriate incoming stream subclass.

gfe-relnote: n/a, no functional change outside QUIC v99-only code.  Protected by existing disabled gfe2_reloadable_flag_quic_enable_version_99.
PiperOrigin-RevId: 262183753
Change-Id: I4147320860b867df0d80ba8fd55106bf779b15b3
diff --git a/quic/test_tools/quic_session_peer.cc b/quic/test_tools/quic_session_peer.cc
index e78b059..1f83909 100644
--- a/quic/test_tools/quic_session_peer.cc
+++ b/quic/test_tools/quic_session_peer.cc
@@ -243,5 +243,12 @@
   session->SendRstStreamInner(id, error, bytes_written, close_write_side_only);
 }
 
+// static
+PendingStream* QuicSessionPeer::GetPendingStream(QuicSession* session,
+                                                 QuicStreamId stream_id) {
+  auto it = session->pending_stream_map_.find(stream_id);
+  return it == session->pending_stream_map_.end() ? nullptr : it->second.get();
+}
+
 }  // namespace test
 }  // namespace quic