Set a minimum number of chaos protection in new protector
This simplifies testing whether chaos protection was performed since now we're guaranteed to get extra frames.
This CL also adds a new e2e test for chaos protection v2, which test ensures that multi-packet chaos protection works as expected with kyber enabled. In particular, it ensures that retransmissions behave correctly.
This change is only made in the new protector, which is behind a flag that is still enabled_blocked_by.
Protected by FLAGS_quic_reloadable_flag_quic_enable_new_chaos_protector.
PiperOrigin-RevId: 703637630
diff --git a/quiche/quic/core/quic_connection_test.cc b/quiche/quic/core/quic_connection_test.cc
index da3e87d..c9bc761 100644
--- a/quiche/quic/core/quic_connection_test.cc
+++ b/quiche/quic/core/quic_connection_test.cc
@@ -10243,7 +10243,7 @@
EXPECT_EQ(connection_.max_packet_length(), writer_->last_packet_size());
// Verify packet process.
- EXPECT_EQ(1u, writer_->crypto_frames().size());
+ EXPECT_LE(1u, writer_->crypto_frames().size());
EXPECT_EQ(0u, writer_->stream_frames().size());
// Verify there is coalesced packet.
EXPECT_NE(nullptr, writer_->coalesced_packet());
@@ -10706,7 +10706,7 @@
// RETRY.
if (GetParam().ack_response == AckResponse::kImmediate) {
EXPECT_EQ(2u, writer_->packets_write_attempts());
- EXPECT_EQ(1u, writer_->framer()->crypto_frames().size());
+ EXPECT_LE(1u, writer_->framer()->crypto_frames().size());
}
}