src/net/third_party/quiche/src/quic/core/quic_dispatcher_test.cc
// Tests that a retransmitted CHLO arrives after a connection for the
// CHLO has been created.
Tests that a retransmitted CHLO arrives after a connection for the
CHLO has been created.
Tests that a retransmitted CHLO arrives after a connection for the CHLO has been created .
TEST_P(BufferedPacketStoreTest, ReceiveRetransmittedCHLO) {
  InSequence s;
  QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
  QuicConnectionId conn_id = TestConnectionId(1);
  ProcessPacket(client_address, conn_id, true,
                quiche::QuicheStrCat("data packet ", 2), CONNECTION_ID_PRESENT,
                PACKET_4BYTE_PACKET_NUMBER,
                2);
  EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_address,
                                              quiche::QuicheStringPiece(), _))
      .Times(1)  
      .WillOnce(Return(ByMove(CreateSession(
          dispatcher_.get(), config_, conn_id, client_address, &mock_helper_,
          &mock_alarm_factory_, &crypto_config_,
          QuicDispatcherPeer::GetCache(dispatcher_.get()), &session1_))));
  EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>(session1_->connection()),
              ProcessUdpPacket(_, _, _))
      .Times(3)  
      .WillRepeatedly(
          WithArg<2>(Invoke([this, conn_id](const QuicEncryptedPacket& packet) {
            ValidatePacket(conn_id, packet);
          })));
  ProcessPacket(client_address, conn_id, true, SerializeFullCHLO());
  ProcessPacket(client_address, conn_id, true, SerializeFullCHLO());
}
TEST_P ( BufferedPacketStoreTest , ReceiveRetransmittedCHLO ) { InSequence s ; QuicSocketAddress client_address ( QuicIpAddress :: Loopback4 ( ) , 1 ) ; QuicConnectionId conn_id = TestConnectionId ( 1 ) ; ProcessPacket ( client_address , conn_id , true , quiche :: QuicheStrCat ( " " , 2 ) , CONNECTION_ID_PRESENT , PACKET_4BYTE_PACKET_NUMBER , 2 ) ; EXPECT_CALL ( * dispatcher_ , CreateQuicSession ( conn_id , client_address , quiche :: QuicheStringPiece ( ) , _ ) ) . Times ( 1 ) . WillOnce ( Return ( ByMove ( CreateSession ( dispatcher_ . get ( ) , config_ , conn_id , client_address , & mock_helper_ , & mock_alarm_factory_ , & crypto_config_ , QuicDispatcherPeer :: GetCache ( dispatcher_ . get ( ) ) , & session1_ ) ) ) ) ; EXPECT_CALL ( * reinterpret_cast < MockQuicConnection * > ( session1_ -> connection ( ) ) , ProcessUdpPacket ( _ , _ , _ ) ) . Times ( 3 ) . WillRepeatedly ( WithArg < 2 > ( Invoke ( [ this , conn_id ] ( const QuicEncryptedPacket & packet ) { ValidatePacket ( conn_id , packet ) ; } ) ) ) ; ProcessPacket ( client_address , conn_id , true , SerializeFullCHLO ( ) ) ; ProcessPacket ( client_address , conn_id , true , SerializeFullCHLO ( ) ) ; }
Tests that a retransmitted CHLO arrives after a connection for the
CHLO has been created.
Tests that a retransmitted CHLO arrives after a connection for the CHLO has been created .
/*packet_number=*/ // When CHLO arrives, a new session should be created, and all packets // buffered should be delivered to the session. // Only triggered by 1st CHLO. // Triggered by 1 data packet and 2 CHLOs.