Add flag to QuicSession indicating that it has been configured
This CL adds a flag to QuicSession that indicates when the QuicSession has been
configured. This needed for follow-on work where IETF QUIC is limited as to the
frames that can be sent _until_ the transport config has been performed.
QuicSession test has been modified to A) artificially perform a configuration
and B) check at test termination that it has been configured.
gfe-relnote: N/A not significant. Other changes all to tests.
PiperOrigin-RevId: 264362154
Change-Id: I1467cd4ed4531c01950d3fb938637e8633de815e
diff --git a/quic/core/quic_session_test.cc b/quic/core/quic_session_test.cc
index 9111ee4..3a6db56 100644
--- a/quic/core/quic_session_test.cc
+++ b/quic/core/quic_session_test.cc
@@ -153,7 +153,10 @@
QuicMakeUnique<NullEncrypter>(connection->perspective()));
}
- ~TestSession() override { delete connection(); }
+ ~TestSession() override {
+ EXPECT_TRUE(is_configured());
+ delete connection();
+ }
TestCryptoStream* GetMutableCryptoStream() override {
return &crypto_stream_;
@@ -329,7 +332,13 @@
kInitialStreamFlowControlWindowForTest);
session_.config()->SetInitialSessionFlowControlWindowToSend(
kInitialSessionFlowControlWindowForTest);
+
+ QuicConfigPeer::SetReceivedMaxIncomingBidirectionalStreams(
+ session_.config(), kDefaultMaxStreamsPerConnection);
+ QuicConfigPeer::SetReceivedMaxIncomingUnidirectionalStreams(
+ session_.config(), kDefaultMaxStreamsPerConnection);
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
+ session_.OnConfigNegotiated();
TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream();
EXPECT_CALL(*crypto_stream, HasPendingRetransmission())
.Times(testing::AnyNumber());