| Index: net/quic/quic_connection_test.cc
|
| diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
|
| index f06b103d1395f2043bd806199d3fd3f868db1b4d..1c34eef5302969a89dac87bdc05b3aebcacf7a10 100644
|
| --- a/net/quic/quic_connection_test.cc
|
| +++ b/net/quic/quic_connection_test.cc
|
| @@ -3518,7 +3518,7 @@ TEST_P(QuicConnectionTest, InitialTimeout) {
|
| QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs - 1));
|
| EXPECT_EQ(default_timeout, connection_.GetTimeoutAlarm()->deadline());
|
|
|
| - EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_CONNECTION_TIMED_OUT, false));
|
| + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_NETWORK_IDLE_TIMEOUT, false));
|
| // Simulate the timeout alarm firing.
|
| clock_.AdvanceTime(QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs - 1));
|
| connection_.GetTimeoutAlarm()->Fire();
|
| @@ -3535,16 +3535,16 @@ TEST_P(QuicConnectionTest, InitialTimeout) {
|
| EXPECT_FALSE(connection_.GetMtuDiscoveryAlarm()->IsSet());
|
| }
|
|
|
| -TEST_P(QuicConnectionTest, OverallTimeout) {
|
| - // Use a shorter overall connection timeout than idle timeout for this test.
|
| +TEST_P(QuicConnectionTest, HandshakeTimeout) {
|
| + // Use a shorter handshake timeout than idle timeout for this test.
|
| const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(5);
|
| connection_.SetNetworkTimeouts(timeout, timeout);
|
| EXPECT_TRUE(connection_.connected());
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(AnyNumber());
|
|
|
| - QuicTime overall_timeout = clock_.ApproximateNow().Add(timeout).Subtract(
|
| + QuicTime handshake_timeout = clock_.ApproximateNow().Add(timeout).Subtract(
|
| QuicTime::Delta::FromSeconds(1));
|
| - EXPECT_EQ(overall_timeout, connection_.GetTimeoutAlarm()->deadline());
|
| + EXPECT_EQ(handshake_timeout, connection_.GetTimeoutAlarm()->deadline());
|
| EXPECT_TRUE(connection_.connected());
|
|
|
| // Send and ack new data 3 seconds later to lengthen the idle timeout.
|
| @@ -3562,8 +3562,7 @@ TEST_P(QuicConnectionTest, OverallTimeout) {
|
|
|
| clock_.AdvanceTime(timeout.Subtract(QuicTime::Delta::FromSeconds(2)));
|
|
|
| - EXPECT_CALL(visitor_,
|
| - OnConnectionClosed(QUIC_CONNECTION_OVERALL_TIMED_OUT, false));
|
| + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_HANDSHAKE_TIMEOUT, false));
|
| // Simulate the timeout alarm firing.
|
| connection_.GetTimeoutAlarm()->Fire();
|
|
|
| @@ -3884,7 +3883,7 @@ TEST_P(QuicConnectionTest, OldTimeoutAfterSend) {
|
| connection_.GetTimeoutAlarm()->deadline());
|
|
|
| // This time, we should time out.
|
| - EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_CONNECTION_TIMED_OUT, false));
|
| + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_NETWORK_IDLE_TIMEOUT, false));
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
|
| clock_.AdvanceTime(five_ms);
|
| EXPECT_EQ(default_timeout.Add(five_ms), clock_.ApproximateNow());
|
| @@ -3944,7 +3943,7 @@ TEST_P(QuicConnectionTest, OldTimeoutAfterSendSilentClose) {
|
| connection_.GetTimeoutAlarm()->deadline());
|
|
|
| // This time, we should time out.
|
| - EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_CONNECTION_TIMED_OUT, false));
|
| + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_NETWORK_IDLE_TIMEOUT, false));
|
| clock_.AdvanceTime(five_ms);
|
| EXPECT_EQ(default_timeout.Add(five_ms), clock_.ApproximateNow());
|
| connection_.GetTimeoutAlarm()->Fire();
|
| @@ -3988,7 +3987,7 @@ TEST_P(QuicConnectionTest, TimeoutAfterSend) {
|
| connection_.GetTimeoutAlarm()->deadline());
|
|
|
| // This time, we should time out.
|
| - EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_CONNECTION_TIMED_OUT, false));
|
| + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_NETWORK_IDLE_TIMEOUT, false));
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
|
| clock_.AdvanceTime(five_ms);
|
| EXPECT_EQ(default_timeout.Add(five_ms), clock_.ApproximateNow());
|
| @@ -4052,7 +4051,7 @@ TEST_P(QuicConnectionTest, NewTimeoutAfterSendSilentClose) {
|
| connection_.GetTimeoutAlarm()->deadline());
|
|
|
| // This time, we should time out.
|
| - EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_CONNECTION_TIMED_OUT, false));
|
| + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_NETWORK_IDLE_TIMEOUT, false));
|
| clock_.AdvanceTime(five_ms);
|
| EXPECT_EQ(default_timeout.Add(five_ms), clock_.ApproximateNow());
|
| connection_.GetTimeoutAlarm()->Fire();
|
| @@ -4098,7 +4097,7 @@ TEST_P(QuicConnectionTest, TimeoutAfterReceive) {
|
| connection_.GetTimeoutAlarm()->deadline());
|
|
|
| // This time, we should time out.
|
| - EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_CONNECTION_TIMED_OUT, false));
|
| + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_NETWORK_IDLE_TIMEOUT, false));
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
|
| clock_.AdvanceTime(five_ms);
|
| EXPECT_EQ(default_timeout.Add(five_ms), clock_.ApproximateNow());
|
| @@ -4153,7 +4152,7 @@ TEST_P(QuicConnectionTest, TimeoutAfterReceiveNotSendWhenUnacked) {
|
|
|
| // Now, send packets while advancing the time and verify that the connection
|
| // eventually times out.
|
| - EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_CONNECTION_TIMED_OUT, false));
|
| + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_NETWORK_IDLE_TIMEOUT, false));
|
| EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(AnyNumber());
|
| for (int i = 0; i < 100 && connection_.connected(); ++i) {
|
| VLOG(1) << "sending data packet";
|
|
|