OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 3138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3149 clock_.AdvanceTime(five_ms); | 3149 clock_.AdvanceTime(five_ms); |
3150 EXPECT_EQ(default_timeout.Add(five_ms), clock_.ApproximateNow()); | 3150 EXPECT_EQ(default_timeout.Add(five_ms), clock_.ApproximateNow()); |
3151 connection_.GetTimeoutAlarm()->Fire(); | 3151 connection_.GetTimeoutAlarm()->Fire(); |
3152 EXPECT_FALSE(connection_.GetTimeoutAlarm()->IsSet()); | 3152 EXPECT_FALSE(connection_.GetTimeoutAlarm()->IsSet()); |
3153 EXPECT_FALSE(connection_.connected()); | 3153 EXPECT_FALSE(connection_.connected()); |
3154 } | 3154 } |
3155 | 3155 |
3156 TEST_P(QuicConnectionTest, TimeoutAfterSendSilentClose) { | 3156 TEST_P(QuicConnectionTest, TimeoutAfterSendSilentClose) { |
3157 // Same test as above, but complete a handshake which enables silent close, | 3157 // Same test as above, but complete a handshake which enables silent close, |
3158 // causing no connection close packet to be sent. | 3158 // causing no connection close packet to be sent. |
3159 ValueRestore<bool> old_flag(&FLAGS_quic_allow_silent_close, true); | |
3160 EXPECT_TRUE(connection_.connected()); | 3159 EXPECT_TRUE(connection_.connected()); |
3161 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _)); | 3160 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _, _)); |
3162 QuicConfig config; | 3161 QuicConfig config; |
3163 | 3162 |
3164 // Create a handshake message that also enables silent close. | 3163 // Create a handshake message that also enables silent close. |
3165 CryptoHandshakeMessage msg; | 3164 CryptoHandshakeMessage msg; |
3166 string error_details; | 3165 string error_details; |
3167 QuicConfig client_config; | 3166 QuicConfig client_config; |
3168 client_config.SetInitialStreamFlowControlWindowToSend( | 3167 client_config.SetInitialStreamFlowControlWindowToSend( |
3169 kInitialStreamFlowControlWindowForTest); | 3168 kInitialStreamFlowControlWindowForTest); |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4421 // Regression test for b/18594622 | 4420 // Regression test for b/18594622 |
4422 scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate); | 4421 scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate); |
4423 EXPECT_DFATAL( | 4422 EXPECT_DFATAL( |
4424 connection_.SendStreamDataWithString(3, "", 0, !kFin, delegate.get()), | 4423 connection_.SendStreamDataWithString(3, "", 0, !kFin, delegate.get()), |
4425 "Attempt to send empty stream frame"); | 4424 "Attempt to send empty stream frame"); |
4426 } | 4425 } |
4427 | 4426 |
4428 } // namespace | 4427 } // namespace |
4429 } // namespace test | 4428 } // namespace test |
4430 } // namespace net | 4429 } // namespace net |
OLD | NEW |