| Index: net/quic/quic_connection_test.cc
|
| diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
|
| index 66cb89c8c60834d1954780c02607857bfbe25284..4e58dfdefee0bdd3a08cd2ca5256325d53d503e6 100644
|
| --- a/net/quic/quic_connection_test.cc
|
| +++ b/net/quic/quic_connection_test.cc
|
| @@ -408,6 +408,7 @@ class TestConnection : public QuicConnection {
|
| factory,
|
| /* owns_writer= */ false,
|
| is_server,
|
| + /* is_secure= */ false,
|
| SupportedVersions(version)) {
|
| // Disable tail loss probes for most tests.
|
| QuicSentPacketManagerPeer::SetMaxTailLossProbes(
|
| @@ -2506,7 +2507,7 @@ TEST_P(QuicConnectionTest, DelayForwardSecureEncryptionUntilManyPacketSent) {
|
|
|
| TEST_P(QuicConnectionTest, BufferNonDecryptablePackets) {
|
| // SetFromConfig is always called after construction from InitializeSession.
|
| - EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
|
| + EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
|
| QuicConfig config;
|
| connection_.SetFromConfig(config);
|
| EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
|
| @@ -2536,7 +2537,7 @@ TEST_P(QuicConnectionTest, BufferNonDecryptablePackets) {
|
|
|
| TEST_P(QuicConnectionTest, Buffer100NonDecryptablePackets) {
|
| // SetFromConfig is always called after construction from InitializeSession.
|
| - EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
|
| + EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
|
| QuicConfig config;
|
| config.set_max_undecryptable_packets(100);
|
| connection_.SetFromConfig(config);
|
| @@ -2775,36 +2776,12 @@ TEST_P(QuicConnectionTest, DontUpdateQuicCongestionFeedbackFrameForRevived) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, InitialTimeout) {
|
| - if (!FLAGS_quic_unified_timeouts) {
|
| - EXPECT_TRUE(connection_.connected());
|
| - EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_CONNECTION_TIMED_OUT, false));
|
| - EXPECT_CALL(*send_algorithm_,
|
| - OnPacketSent(_, _, _, _, _)).Times(AnyNumber());
|
| -
|
| - QuicTime default_timeout = clock_.ApproximateNow().Add(
|
| - QuicTime::Delta::FromSeconds(kDefaultIdleTimeoutSecs));
|
| - EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
|
| -
|
| - // Simulate the timeout alarm firing.
|
| - clock_.AdvanceTime(QuicTime::Delta::FromSeconds(kDefaultIdleTimeoutSecs));
|
| - connection_.GetTimeoutAlarm()->Fire();
|
| -
|
| - EXPECT_FALSE(connection_.GetTimeoutAlarm()->IsSet());
|
| - EXPECT_FALSE(connection_.connected());
|
| -
|
| - EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
|
| - EXPECT_FALSE(connection_.GetPingAlarm()->IsSet());
|
| - EXPECT_FALSE(connection_.GetResumeWritesAlarm()->IsSet());
|
| - EXPECT_FALSE(connection_.GetRetransmissionAlarm()->IsSet());
|
| - EXPECT_FALSE(connection_.GetSendAlarm()->IsSet());
|
| - return;
|
| - }
|
| EXPECT_TRUE(connection_.connected());
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(AnyNumber());
|
| EXPECT_FALSE(connection_.GetTimeoutAlarm()->IsSet());
|
|
|
| // SetFromConfig sets the initial timeouts before negotiation.
|
| - EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
|
| + EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
|
| QuicConfig config;
|
| connection_.SetFromConfig(config);
|
| // Subtract a second from the idle timeout on the client side.
|
| @@ -2913,44 +2890,8 @@ TEST_P(QuicConnectionTest, PingAfterSend) {
|
| }
|
|
|
| TEST_P(QuicConnectionTest, TimeoutAfterSend) {
|
| - if (!FLAGS_quic_unified_timeouts) {
|
| - EXPECT_TRUE(connection_.connected());
|
| -
|
| - QuicTime default_timeout = clock_.ApproximateNow().Add(
|
| - QuicTime::Delta::FromSeconds(kDefaultIdleTimeoutSecs));
|
| -
|
| - // When we send a packet, the timeout will change to 5000 +
|
| - // kDefaultInitialTimeoutSecs.
|
| - clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(5));
|
| -
|
| - // Send an ack so we don't set the retransmission alarm.
|
| - SendAckPacketToPeer();
|
| - EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
|
| -
|
| - // The original alarm will fire. We should not time out because we had a
|
| - // network event at t=5000. The alarm will reregister.
|
| - clock_.AdvanceTime(QuicTime::Delta::FromMicroseconds(
|
| - kDefaultIdleTimeoutSecs * 1000000 - 5000));
|
| - EXPECT_EQ(default_timeout, clock_.ApproximateNow());
|
| - connection_.GetTimeoutAlarm()->Fire();
|
| - EXPECT_TRUE(connection_.GetTimeoutAlarm()->IsSet());
|
| - EXPECT_TRUE(connection_.connected());
|
| - EXPECT_EQ(default_timeout.Add(QuicTime::Delta::FromMilliseconds(5)),
|
| - connection_.GetTimeoutAlarm()->deadline());
|
| -
|
| - // This time, we should time out.
|
| - EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_CONNECTION_TIMED_OUT, false));
|
| - EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
|
| - clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(5));
|
| - EXPECT_EQ(default_timeout.Add(QuicTime::Delta::FromMilliseconds(5)),
|
| - clock_.ApproximateNow());
|
| - connection_.GetTimeoutAlarm()->Fire();
|
| - EXPECT_FALSE(connection_.GetTimeoutAlarm()->IsSet());
|
| - EXPECT_FALSE(connection_.connected());
|
| - return;
|
| - }
|
| EXPECT_TRUE(connection_.connected());
|
| - EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
|
| + EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _));
|
| QuicConfig config;
|
| connection_.SetFromConfig(config);
|
|
|
| @@ -3055,7 +2996,7 @@ TEST_P(QuicConnectionTest, LoopThroughSendingPacketsWithTruncation) {
|
|
|
| // Set up a larger payload than will fit in one packet.
|
| const string payload(connection_.max_packet_length(), 'a');
|
| - EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)).Times(AnyNumber());
|
| + EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _)).Times(AnyNumber());
|
|
|
| // Now send some packets with no truncation.
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2);
|
|
|