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

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

Issue 357573004: Land Recent QUIC Changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase with TOT Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_config.cc ('k') | net/quic/quic_crypto_stream_test.cc » ('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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 client_config.SetInitialRoundTripTimeUsToSend( 102 client_config.SetInitialRoundTripTimeUsToSend(
103 10 * base::Time::kMicrosecondsPerMillisecond); 103 10 * base::Time::kMicrosecondsPerMillisecond);
104 client_config.SetInitialFlowControlWindowToSend( 104 client_config.SetInitialFlowControlWindowToSend(
105 2 * kInitialSessionFlowControlWindowForTest); 105 2 * kInitialSessionFlowControlWindowForTest);
106 client_config.SetInitialStreamFlowControlWindowToSend( 106 client_config.SetInitialStreamFlowControlWindowToSend(
107 2 * kInitialStreamFlowControlWindowForTest); 107 2 * kInitialStreamFlowControlWindowForTest);
108 client_config.SetInitialSessionFlowControlWindowToSend( 108 client_config.SetInitialSessionFlowControlWindowToSend(
109 2 * kInitialSessionFlowControlWindowForTest); 109 2 * kInitialSessionFlowControlWindowForTest);
110 QuicTagVector copt; 110 QuicTagVector copt;
111 copt.push_back(kTBBR); 111 copt.push_back(kTBBR);
112 client_config.SetCongestionOptionsToSend(copt); 112 client_config.SetConnectionOptionsToSend(copt);
113 CryptoHandshakeMessage msg; 113 CryptoHandshakeMessage msg;
114 client_config.ToHandshakeMessage(&msg); 114 client_config.ToHandshakeMessage(&msg);
115 string error_details; 115 string error_details;
116 const QuicErrorCode error = 116 const QuicErrorCode error =
117 config_.ProcessPeerHello(msg, CLIENT, &error_details); 117 config_.ProcessPeerHello(msg, CLIENT, &error_details);
118 EXPECT_EQ(QUIC_NO_ERROR, error); 118 EXPECT_EQ(QUIC_NO_ERROR, error);
119 EXPECT_TRUE(config_.negotiated()); 119 EXPECT_TRUE(config_.negotiated());
120 EXPECT_EQ(kQBIC, config_.congestion_feedback()); 120 EXPECT_EQ(kQBIC, config_.congestion_feedback());
121 EXPECT_EQ(QuicTime::Delta::FromSeconds(kDefaultTimeoutSecs), 121 EXPECT_EQ(QuicTime::Delta::FromSeconds(kDefaultTimeoutSecs),
122 config_.idle_connection_state_lifetime()); 122 config_.idle_connection_state_lifetime());
123 EXPECT_EQ(kDefaultMaxStreamsPerConnection, 123 EXPECT_EQ(kDefaultMaxStreamsPerConnection,
124 config_.max_streams_per_connection()); 124 config_.max_streams_per_connection());
125 EXPECT_EQ(QuicTime::Delta::FromSeconds(0), config_.keepalive_timeout()); 125 EXPECT_EQ(QuicTime::Delta::FromSeconds(0), config_.keepalive_timeout());
126 EXPECT_EQ(10 * base::Time::kMicrosecondsPerMillisecond, 126 EXPECT_EQ(10 * base::Time::kMicrosecondsPerMillisecond,
127 config_.ReceivedInitialRoundTripTimeUs()); 127 config_.ReceivedInitialRoundTripTimeUs());
128 EXPECT_FALSE(config_.HasReceivedLossDetection()); 128 EXPECT_FALSE(config_.HasReceivedLossDetection());
129 EXPECT_TRUE(config_.HasReceivedCongestionOptions()); 129 EXPECT_TRUE(config_.HasReceivedConnectionOptions());
130 EXPECT_EQ(1u, config_.ReceivedCongestionOptions().size()); 130 EXPECT_EQ(1u, config_.ReceivedConnectionOptions().size());
131 EXPECT_EQ(config_.ReceivedCongestionOptions()[0], kTBBR); 131 EXPECT_EQ(config_.ReceivedConnectionOptions()[0], kTBBR);
132 EXPECT_EQ(config_.ReceivedInitialFlowControlWindowBytes(), 132 EXPECT_EQ(config_.ReceivedInitialFlowControlWindowBytes(),
133 2 * kInitialSessionFlowControlWindowForTest); 133 2 * kInitialSessionFlowControlWindowForTest);
134 EXPECT_EQ(config_.ReceivedInitialStreamFlowControlWindowBytes(), 134 EXPECT_EQ(config_.ReceivedInitialStreamFlowControlWindowBytes(),
135 2 * kInitialStreamFlowControlWindowForTest); 135 2 * kInitialStreamFlowControlWindowForTest);
136 EXPECT_EQ(config_.ReceivedInitialSessionFlowControlWindowBytes(), 136 EXPECT_EQ(config_.ReceivedInitialSessionFlowControlWindowBytes(),
137 2 * kInitialSessionFlowControlWindowForTest); 137 2 * kInitialSessionFlowControlWindowForTest);
138 } 138 }
139 139
140 TEST_F(QuicConfigTest, ProcessServerHello) { 140 TEST_F(QuicConfigTest, ProcessServerHello) {
141 QuicConfig server_config; 141 QuicConfig server_config;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 EXPECT_DFATAL(config.SetInitialFlowControlWindowToSend(kInvalidWindow), 294 EXPECT_DFATAL(config.SetInitialFlowControlWindowToSend(kInvalidWindow),
295 "Initial flow control receive window"); 295 "Initial flow control receive window");
296 296
297 EXPECT_EQ(kDefaultFlowControlSendWindow, 297 EXPECT_EQ(kDefaultFlowControlSendWindow,
298 config.GetInitialFlowControlWindowToSend()); 298 config.GetInitialFlowControlWindowToSend());
299 } 299 }
300 300
301 } // namespace 301 } // namespace
302 } // namespace test 302 } // namespace test
303 } // namespace net 303 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_config.cc ('k') | net/quic/quic_crypto_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698