Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Side by Side Diff: net/quic/quic_config_test.cc

Issue 1785863002: Remove FEC related connection options and update FEC related comment in code base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116555910
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/crypto/crypto_protocol.h ('k') | net/quic/quic_connection_stats.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/quic_config.h" 5 #include "net/quic/quic_config.h"
6 6
7 #include "net/quic/crypto/crypto_handshake_message.h" 7 #include "net/quic/crypto/crypto_handshake_message.h"
8 #include "net/quic/crypto/crypto_protocol.h" 8 #include "net/quic/crypto/crypto_protocol.h"
9 #include "net/quic/quic_flags.h" 9 #include "net/quic/quic_flags.h"
10 #include "net/quic/quic_protocol.h" 10 #include "net/quic/quic_protocol.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 client_config.SetMaxStreamsPerConnection(2 * kDefaultMaxStreamsPerConnection, 70 client_config.SetMaxStreamsPerConnection(2 * kDefaultMaxStreamsPerConnection,
71 kDefaultMaxStreamsPerConnection); 71 kDefaultMaxStreamsPerConnection);
72 client_config.SetInitialRoundTripTimeUsToSend(10 * kNumMicrosPerMilli); 72 client_config.SetInitialRoundTripTimeUsToSend(10 * kNumMicrosPerMilli);
73 client_config.SetInitialStreamFlowControlWindowToSend( 73 client_config.SetInitialStreamFlowControlWindowToSend(
74 2 * kInitialStreamFlowControlWindowForTest); 74 2 * kInitialStreamFlowControlWindowForTest);
75 client_config.SetInitialSessionFlowControlWindowToSend( 75 client_config.SetInitialSessionFlowControlWindowToSend(
76 2 * kInitialSessionFlowControlWindowForTest); 76 2 * kInitialSessionFlowControlWindowForTest);
77 client_config.SetSocketReceiveBufferToSend(kDefaultSocketReceiveBuffer); 77 client_config.SetSocketReceiveBufferToSend(kDefaultSocketReceiveBuffer);
78 QuicTagVector copt; 78 QuicTagVector copt;
79 copt.push_back(kTBBR); 79 copt.push_back(kTBBR);
80 copt.push_back(kFHDR);
81 client_config.SetConnectionOptionsToSend(copt); 80 client_config.SetConnectionOptionsToSend(copt);
82 CryptoHandshakeMessage msg; 81 CryptoHandshakeMessage msg;
83 client_config.ToHandshakeMessage(&msg); 82 client_config.ToHandshakeMessage(&msg);
84 83
85 string error_details; 84 string error_details;
86 QuicTagVector initial_received_options; 85 QuicTagVector initial_received_options;
87 initial_received_options.push_back(kIW50); 86 initial_received_options.push_back(kIW50);
88 EXPECT_TRUE( 87 EXPECT_TRUE(
89 config_.SetInitialReceivedConnectionOptions(initial_received_options)); 88 config_.SetInitialReceivedConnectionOptions(initial_received_options));
90 EXPECT_FALSE( 89 EXPECT_FALSE(
91 config_.SetInitialReceivedConnectionOptions(initial_received_options)) 90 config_.SetInitialReceivedConnectionOptions(initial_received_options))
92 << "You can only set initial options once."; 91 << "You can only set initial options once.";
93 const QuicErrorCode error = 92 const QuicErrorCode error =
94 config_.ProcessPeerHello(msg, CLIENT, &error_details); 93 config_.ProcessPeerHello(msg, CLIENT, &error_details);
95 EXPECT_FALSE( 94 EXPECT_FALSE(
96 config_.SetInitialReceivedConnectionOptions(initial_received_options)) 95 config_.SetInitialReceivedConnectionOptions(initial_received_options))
97 << "You cannot set initial options after the hello."; 96 << "You cannot set initial options after the hello.";
98 EXPECT_EQ(QUIC_NO_ERROR, error); 97 EXPECT_EQ(QUIC_NO_ERROR, error);
99 EXPECT_TRUE(config_.negotiated()); 98 EXPECT_TRUE(config_.negotiated());
100 EXPECT_EQ(QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs), 99 EXPECT_EQ(QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs),
101 config_.IdleConnectionStateLifetime()); 100 config_.IdleConnectionStateLifetime());
102 EXPECT_EQ(kDefaultMaxStreamsPerConnection, config_.MaxStreamsPerConnection()); 101 EXPECT_EQ(kDefaultMaxStreamsPerConnection, config_.MaxStreamsPerConnection());
103 EXPECT_EQ(10 * kNumMicrosPerMilli, config_.ReceivedInitialRoundTripTimeUs()); 102 EXPECT_EQ(10 * kNumMicrosPerMilli, config_.ReceivedInitialRoundTripTimeUs());
104 EXPECT_TRUE(config_.HasReceivedConnectionOptions()); 103 EXPECT_TRUE(config_.HasReceivedConnectionOptions());
105 EXPECT_EQ(3u, config_.ReceivedConnectionOptions().size()); 104 EXPECT_EQ(2u, config_.ReceivedConnectionOptions().size());
106 EXPECT_EQ(config_.ReceivedConnectionOptions()[0], kIW50); 105 EXPECT_EQ(config_.ReceivedConnectionOptions()[0], kIW50);
107 EXPECT_EQ(config_.ReceivedConnectionOptions()[1], kTBBR); 106 EXPECT_EQ(config_.ReceivedConnectionOptions()[1], kTBBR);
108 EXPECT_EQ(config_.ReceivedConnectionOptions()[2], kFHDR);
109 EXPECT_EQ(config_.ReceivedInitialStreamFlowControlWindowBytes(), 107 EXPECT_EQ(config_.ReceivedInitialStreamFlowControlWindowBytes(),
110 2 * kInitialStreamFlowControlWindowForTest); 108 2 * kInitialStreamFlowControlWindowForTest);
111 EXPECT_EQ(config_.ReceivedInitialSessionFlowControlWindowBytes(), 109 EXPECT_EQ(config_.ReceivedInitialSessionFlowControlWindowBytes(),
112 2 * kInitialSessionFlowControlWindowForTest); 110 2 * kInitialSessionFlowControlWindowForTest);
113 EXPECT_EQ(config_.ReceivedSocketReceiveBuffer(), kDefaultSocketReceiveBuffer); 111 EXPECT_EQ(config_.ReceivedSocketReceiveBuffer(), kDefaultSocketReceiveBuffer);
114 } 112 }
115 113
116 TEST_F(QuicConfigTest, ProcessServerHello) { 114 TEST_F(QuicConfigTest, ProcessServerHello) {
117 QuicConfig server_config; 115 QuicConfig server_config;
118 QuicTagVector cgst; 116 QuicTagVector cgst;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 "Initial stream flow control receive window"); 219 "Initial stream flow control receive window");
222 220
223 EXPECT_EQ(kMinimumFlowControlSendWindow, 221 EXPECT_EQ(kMinimumFlowControlSendWindow,
224 config.GetInitialStreamFlowControlWindowToSend()); 222 config.GetInitialStreamFlowControlWindowToSend());
225 } 223 }
226 224
227 TEST_F(QuicConfigTest, HasClientSentConnectionOption) { 225 TEST_F(QuicConfigTest, HasClientSentConnectionOption) {
228 QuicConfig client_config; 226 QuicConfig client_config;
229 QuicTagVector copt; 227 QuicTagVector copt;
230 copt.push_back(kTBBR); 228 copt.push_back(kTBBR);
231 copt.push_back(kFHDR);
232 client_config.SetConnectionOptionsToSend(copt); 229 client_config.SetConnectionOptionsToSend(copt);
233 EXPECT_TRUE(client_config.HasClientSentConnectionOption( 230 EXPECT_TRUE(client_config.HasClientSentConnectionOption(
234 kTBBR, Perspective::IS_CLIENT)); 231 kTBBR, Perspective::IS_CLIENT));
235 EXPECT_TRUE(client_config.HasClientSentConnectionOption(
236 kFHDR, Perspective::IS_CLIENT));
237 232
238 CryptoHandshakeMessage msg; 233 CryptoHandshakeMessage msg;
239 client_config.ToHandshakeMessage(&msg); 234 client_config.ToHandshakeMessage(&msg);
240 235
241 string error_details; 236 string error_details;
242 const QuicErrorCode error = 237 const QuicErrorCode error =
243 config_.ProcessPeerHello(msg, CLIENT, &error_details); 238 config_.ProcessPeerHello(msg, CLIENT, &error_details);
244 EXPECT_EQ(QUIC_NO_ERROR, error); 239 EXPECT_EQ(QUIC_NO_ERROR, error);
245 EXPECT_TRUE(config_.negotiated()); 240 EXPECT_TRUE(config_.negotiated());
246 241
247 EXPECT_TRUE(config_.HasReceivedConnectionOptions()); 242 EXPECT_TRUE(config_.HasReceivedConnectionOptions());
248 EXPECT_EQ(2u, config_.ReceivedConnectionOptions().size()); 243 EXPECT_EQ(1u, config_.ReceivedConnectionOptions().size());
249 EXPECT_TRUE( 244 EXPECT_TRUE(
250 config_.HasClientSentConnectionOption(kTBBR, Perspective::IS_SERVER)); 245 config_.HasClientSentConnectionOption(kTBBR, Perspective::IS_SERVER));
251 EXPECT_TRUE(
252 config_.HasClientSentConnectionOption(kFHDR, Perspective::IS_SERVER));
253 } 246 }
254 247
255 } // namespace 248 } // namespace
256 } // namespace test 249 } // namespace test
257 } // namespace net 250 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_protocol.h ('k') | net/quic/quic_connection_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698