src/net/third_party/quiche/src/quic/core/quic_dispatcher_test.cc
// Tests that expiration of a connection add connection id to time wait list.
Tests that expiration of a connection add connection id to time wait list.
Tests that expiration of a connection add connection id to time wait list .
TEST_P(BufferedPacketStoreTest, ReceiveCHLOAfterExpiration) {
  InSequence s;
  CreateTimeWaitListManager();
  QuicBufferedPacketStore* store =
      QuicDispatcherPeer::GetBufferedPackets(dispatcher_.get());
  QuicBufferedPacketStorePeer::set_clock(store, mock_helper_.GetClock());
  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);
  mock_helper_.AdvanceTime(
      QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs));
  QuicAlarm* alarm = QuicBufferedPacketStorePeer::expiration_alarm(store);
  alarm->Cancel();
  store->OnExpirationTimeout();
  ASSERT_TRUE(time_wait_list_manager_->IsConnectionIdInTimeWait(conn_id));
  EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, conn_id, _, _));
  ProcessPacket(client_address, conn_id, true, SerializeFullCHLO());
}
TEST_P ( BufferedPacketStoreTest , ReceiveCHLOAfterExpiration ) { InSequence s ; CreateTimeWaitListManager ( ) ; QuicBufferedPacketStore * store = QuicDispatcherPeer :: GetBufferedPackets ( dispatcher_ . get ( ) ) ; QuicBufferedPacketStorePeer :: set_clock ( store , mock_helper_ . GetClock ( ) ) ; 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 ) ; mock_helper_ . AdvanceTime ( QuicTime :: Delta :: FromSeconds ( kInitialIdleTimeoutSecs ) ) ; QuicAlarm * alarm = QuicBufferedPacketStorePeer :: expiration_alarm ( store ) ; alarm -> Cancel ( ) ; store -> OnExpirationTimeout ( ) ; ASSERT_TRUE ( time_wait_list_manager_ -> IsConnectionIdInTimeWait ( conn_id ) ) ; EXPECT_CALL ( * time_wait_list_manager_ , ProcessPacket ( _ , _ , conn_id , _ , _ ) ) ; ProcessPacket ( client_address , conn_id , true , SerializeFullCHLO ( ) ) ; }
Tests that expiration of a connection add connection id to time wait list.
Tests that expiration of a connection add connection id to time wait list .
/*packet_number=*/ // Cancel alarm as if it had been fired. // New arrived CHLO will be dropped because this connection is in time wait // list.