OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/core/quic_config.h" | 5 #include "net/quic/core/quic_config.h" |
6 | 6 |
7 #include "net/quic/core/crypto/crypto_handshake_message.h" | 7 #include "net/quic/core/crypto/crypto_handshake_message.h" |
8 #include "net/quic/core/crypto/crypto_protocol.h" | 8 #include "net/quic/core/crypto/crypto_protocol.h" |
9 #include "net/quic/core/quic_flags.h" | 9 #include "net/quic/core/quic_flags.h" |
10 #include "net/quic/core/quic_protocol.h" | 10 #include "net/quic/core/quic_protocol.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 const QuicErrorCode error = | 212 const QuicErrorCode error = |
213 config_.ProcessPeerHello(msg, SERVER, &error_details); | 213 config_.ProcessPeerHello(msg, SERVER, &error_details); |
214 EXPECT_EQ(QUIC_INVALID_NEGOTIATED_VALUE, error); | 214 EXPECT_EQ(QUIC_INVALID_NEGOTIATED_VALUE, error); |
215 } | 215 } |
216 | 216 |
217 TEST_F(QuicConfigTest, InvalidFlowControlWindow) { | 217 TEST_F(QuicConfigTest, InvalidFlowControlWindow) { |
218 // QuicConfig should not accept an invalid flow control window to send to the | 218 // QuicConfig should not accept an invalid flow control window to send to the |
219 // peer: the receive window must be at least the default of 16 Kb. | 219 // peer: the receive window must be at least the default of 16 Kb. |
220 QuicConfig config; | 220 QuicConfig config; |
221 const uint64_t kInvalidWindow = kMinimumFlowControlSendWindow - 1; | 221 const uint64_t kInvalidWindow = kMinimumFlowControlSendWindow - 1; |
222 EXPECT_DFATAL(config.SetInitialStreamFlowControlWindowToSend(kInvalidWindow), | 222 EXPECT_QUIC_BUG( |
223 "Initial stream flow control receive window"); | 223 config.SetInitialStreamFlowControlWindowToSend(kInvalidWindow), |
| 224 "Initial stream flow control receive window"); |
224 | 225 |
225 EXPECT_EQ(kMinimumFlowControlSendWindow, | 226 EXPECT_EQ(kMinimumFlowControlSendWindow, |
226 config.GetInitialStreamFlowControlWindowToSend()); | 227 config.GetInitialStreamFlowControlWindowToSend()); |
227 } | 228 } |
228 | 229 |
229 TEST_F(QuicConfigTest, HasClientSentConnectionOption) { | 230 TEST_F(QuicConfigTest, HasClientSentConnectionOption) { |
230 QuicConfig client_config; | 231 QuicConfig client_config; |
231 QuicTagVector copt; | 232 QuicTagVector copt; |
232 copt.push_back(kTBBR); | 233 copt.push_back(kTBBR); |
233 client_config.SetConnectionOptionsToSend(copt); | 234 client_config.SetConnectionOptionsToSend(copt); |
(...skipping 11 matching lines...) Expand all Loading... |
245 | 246 |
246 EXPECT_TRUE(config_.HasReceivedConnectionOptions()); | 247 EXPECT_TRUE(config_.HasReceivedConnectionOptions()); |
247 EXPECT_EQ(1u, config_.ReceivedConnectionOptions().size()); | 248 EXPECT_EQ(1u, config_.ReceivedConnectionOptions().size()); |
248 EXPECT_TRUE( | 249 EXPECT_TRUE( |
249 config_.HasClientSentConnectionOption(kTBBR, Perspective::IS_SERVER)); | 250 config_.HasClientSentConnectionOption(kTBBR, Perspective::IS_SERVER)); |
250 } | 251 } |
251 | 252 |
252 } // namespace | 253 } // namespace |
253 } // namespace test | 254 } // namespace test |
254 } // namespace net | 255 } // namespace net |
OLD | NEW |