Allow changing max_packet_size from QuicConfig

gfe-relnote: add max_packet_size config, protected by disabled TLS flag
PiperOrigin-RevId: 279780722
Change-Id: I963c00a3023e83fc0c0a4fa6432a99b83cb97c18
diff --git a/quic/core/quic_config_test.cc b/quic/core/quic_config_test.cc
index e0eb304..882516e 100644
--- a/quic/core/quic_config_test.cc
+++ b/quic/core/quic_config_test.cc
@@ -21,6 +21,8 @@
 namespace test {
 namespace {
 
+const uint32_t kMaxPacketSizeForTest = 1234;
+
 class QuicConfigTest : public QuicTestWithParam<QuicTransportVersion> {
  protected:
   QuicConfig config_;
@@ -47,6 +49,8 @@
   EXPECT_FALSE(
       config_.HasReceivedInitialMaxStreamDataBytesOutgoingBidirectional());
   EXPECT_FALSE(config_.HasReceivedInitialMaxStreamDataBytesUnidirectional());
+  EXPECT_EQ(kMaxIncomingPacketSize, config_.GetMaxPacketSizeToSend());
+  EXPECT_FALSE(config_.HasReceivedMaxPacketSize());
 }
 
 TEST_P(QuicConfigTest, AutoSetIetfFlowControl) {
@@ -391,6 +395,7 @@
       3 * kMinimumFlowControlSendWindow);
   config_.SetInitialMaxStreamDataBytesUnidirectionalToSend(
       4 * kMinimumFlowControlSendWindow);
+  config_.SetMaxPacketSizeToSend(kMaxPacketSizeForTest);
 
   TransportParameters params;
   config_.FillTransportParameters(&params);
@@ -404,6 +409,8 @@
 
   EXPECT_EQ(static_cast<uint64_t>(kMaximumIdleTimeoutSecs * 1000),
             params.idle_timeout_milliseconds.value());
+
+  EXPECT_EQ(kMaxPacketSizeForTest, params.max_packet_size.value());
 }
 
 TEST_P(QuicConfigTest, ProcessTransportParametersServer) {
@@ -415,6 +422,7 @@
       3 * kMinimumFlowControlSendWindow);
   params.initial_max_stream_data_uni.set_value(4 *
                                                kMinimumFlowControlSendWindow);
+  params.max_packet_size.set_value(kMaxPacketSizeForTest);
 
   std::string error_details;
   EXPECT_EQ(QUIC_NO_ERROR,
@@ -433,6 +441,9 @@
   ASSERT_TRUE(config_.HasReceivedInitialMaxStreamDataBytesUnidirectional());
   EXPECT_EQ(4 * kMinimumFlowControlSendWindow,
             config_.ReceivedInitialMaxStreamDataBytesUnidirectional());
+
+  ASSERT_TRUE(config_.HasReceivedMaxPacketSize());
+  EXPECT_EQ(kMaxPacketSizeForTest, config_.ReceivedMaxPacketSize());
 }
 
 }  // namespace