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_stream_factory.h" | 5 #include "net/quic/quic_stream_factory.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "net/base/test_data_directory.h" | 9 #include "net/base/test_data_directory.h" |
10 #include "net/cert/cert_verifier.h" | 10 #include "net/cert/cert_verifier.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 return &factory->crypto_config_; | 45 return &factory->crypto_config_; |
46 } | 46 } |
47 | 47 |
48 static bool HasActiveSession(QuicStreamFactory* factory, | 48 static bool HasActiveSession(QuicStreamFactory* factory, |
49 const HostPortPair& host_port_pair, | 49 const HostPortPair& host_port_pair, |
50 bool is_https) { | 50 bool is_https) { |
51 QuicServerId server_id(host_port_pair, is_https, PRIVACY_MODE_DISABLED); | 51 QuicServerId server_id(host_port_pair, is_https, PRIVACY_MODE_DISABLED); |
52 return factory->HasActiveSession(server_id); | 52 return factory->HasActiveSession(server_id); |
53 } | 53 } |
54 | 54 |
55 static QuicClientSession* GetActiveSession( | 55 static QuicClientSession* GetActiveSession(QuicStreamFactory* factory, |
56 QuicStreamFactory* factory, | 56 const HostPortPair& host_port_pair, |
57 const HostPortPair& host_port_pair, | 57 bool is_https) { |
58 bool is_https) { | |
59 QuicServerId server_id(host_port_pair, is_https, PRIVACY_MODE_DISABLED); | 58 QuicServerId server_id(host_port_pair, is_https, PRIVACY_MODE_DISABLED); |
60 DCHECK(factory->HasActiveSession(server_id)); | 59 DCHECK(factory->HasActiveSession(server_id)); |
61 return factory->active_sessions_[server_id]; | 60 return factory->active_sessions_[server_id]; |
62 } | 61 } |
63 | 62 |
64 static scoped_ptr<QuicHttpStream> CreateIfSessionExists( | 63 static scoped_ptr<QuicHttpStream> CreateIfSessionExists( |
65 QuicStreamFactory* factory, | 64 QuicStreamFactory* factory, |
66 const HostPortPair& host_port_pair, | 65 const HostPortPair& host_port_pair, |
67 bool is_https, | 66 bool is_https, |
68 const BoundNetLog& net_log) { | 67 const BoundNetLog& net_log) { |
69 QuicServerId server_id(host_port_pair, is_https, PRIVACY_MODE_DISABLED); | 68 QuicServerId server_id(host_port_pair, is_https, PRIVACY_MODE_DISABLED); |
70 return factory->CreateIfSessionExists(server_id, net_log); | 69 return factory->CreateIfSessionExists(server_id, net_log); |
71 } | 70 } |
72 | 71 |
73 static bool IsLiveSession(QuicStreamFactory* factory, | 72 static bool IsLiveSession(QuicStreamFactory* factory, |
74 QuicClientSession* session) { | 73 QuicClientSession* session) { |
75 for (QuicStreamFactory::SessionIdMap::iterator it = | 74 for (QuicStreamFactory::SessionIdMap::iterator it = |
76 factory->all_sessions_.begin(); | 75 factory->all_sessions_.begin(); |
77 it != factory->all_sessions_.end(); ++it) { | 76 it != factory->all_sessions_.end(); |
| 77 ++it) { |
78 if (it->first == session) | 78 if (it->first == session) |
79 return true; | 79 return true; |
80 } | 80 } |
81 return false; | 81 return false; |
82 } | 82 } |
83 }; | 83 }; |
84 | 84 |
85 class QuicStreamFactoryTest : public ::testing::TestWithParam<QuicVersion> { | 85 class QuicStreamFactoryTest : public ::testing::TestWithParam<QuicVersion> { |
86 protected: | 86 protected: |
87 QuicStreamFactoryTest() | 87 QuicStreamFactoryTest() |
88 : random_generator_(0), | 88 : random_generator_(0), |
89 maker_(GetParam(), 0), | 89 maker_(GetParam(), 0), |
90 clock_(new MockClock()), | 90 clock_(new MockClock()), |
91 cert_verifier_(CertVerifier::CreateDefault()), | 91 cert_verifier_(CertVerifier::CreateDefault()), |
92 factory_(&host_resolver_, &socket_factory_, | 92 factory_(&host_resolver_, |
| 93 &socket_factory_, |
93 base::WeakPtr<HttpServerProperties>(), | 94 base::WeakPtr<HttpServerProperties>(), |
94 cert_verifier_.get(), | 95 cert_verifier_.get(), |
95 &crypto_client_stream_factory_, | 96 &crypto_client_stream_factory_, |
96 &random_generator_, clock_, kDefaultMaxPacketSize, | 97 &random_generator_, |
97 SupportedVersions(GetParam()), true, true, true), | 98 clock_, |
| 99 kDefaultMaxPacketSize, |
| 100 SupportedVersions(GetParam()), |
| 101 true, |
| 102 true, |
| 103 true), |
98 host_port_pair_(kDefaultServerHostName, kDefaultServerPort), | 104 host_port_pair_(kDefaultServerHostName, kDefaultServerPort), |
99 is_https_(false), | 105 is_https_(false), |
100 privacy_mode_(PRIVACY_MODE_DISABLED) { | 106 privacy_mode_(PRIVACY_MODE_DISABLED) { |
101 factory_.set_require_confirmation(false); | 107 factory_.set_require_confirmation(false); |
102 } | 108 } |
103 | 109 |
104 scoped_ptr<QuicHttpStream> CreateIfSessionExists( | 110 scoped_ptr<QuicHttpStream> CreateIfSessionExists( |
105 const HostPortPair& host_port_pair, | 111 const HostPortPair& host_port_pair, |
106 const BoundNetLog& net_log) { | 112 const BoundNetLog& net_log) { |
107 return QuicStreamFactoryPeer::CreateIfSessionExists( | 113 return QuicStreamFactoryPeer::CreateIfSessionExists( |
108 &factory_, host_port_pair, false, net_log_); | 114 &factory_, host_port_pair, false, net_log_); |
109 } | 115 } |
110 | 116 |
111 int GetSourcePortForNewSession(const HostPortPair& destination) { | 117 int GetSourcePortForNewSession(const HostPortPair& destination) { |
112 return GetSourcePortForNewSessionInner(destination, false); | 118 return GetSourcePortForNewSessionInner(destination, false); |
113 } | 119 } |
114 | 120 |
115 int GetSourcePortForNewSessionAndGoAway( | 121 int GetSourcePortForNewSessionAndGoAway(const HostPortPair& destination) { |
116 const HostPortPair& destination) { | |
117 return GetSourcePortForNewSessionInner(destination, true); | 122 return GetSourcePortForNewSessionInner(destination, true); |
118 } | 123 } |
119 | 124 |
120 int GetSourcePortForNewSessionInner(const HostPortPair& destination, | 125 int GetSourcePortForNewSessionInner(const HostPortPair& destination, |
121 bool goaway_received) { | 126 bool goaway_received) { |
122 // Should only be called if there is no active session for this destination. | 127 // Should only be called if there is no active session for this destination. |
123 EXPECT_EQ(NULL, CreateIfSessionExists(destination, net_log_).get()); | 128 EXPECT_EQ(NULL, CreateIfSessionExists(destination, net_log_).get()); |
124 size_t socket_count = socket_factory_.udp_client_sockets().size(); | 129 size_t socket_count = socket_factory_.udp_client_sockets().size(); |
125 | 130 |
126 MockRead reads[] = { | 131 MockRead reads[] = { |
127 MockRead(ASYNC, OK, 0) // EOF | 132 MockRead(ASYNC, OK, 0) // EOF |
128 }; | 133 }; |
129 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 134 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
130 socket_data.StopAfter(1); | 135 socket_data.StopAfter(1); |
131 socket_factory_.AddSocketDataProvider(&socket_data); | 136 socket_factory_.AddSocketDataProvider(&socket_data); |
132 | 137 |
133 QuicStreamRequest request(&factory_); | 138 QuicStreamRequest request(&factory_); |
134 EXPECT_EQ(ERR_IO_PENDING, | 139 EXPECT_EQ(ERR_IO_PENDING, |
135 request.Request(destination, | 140 request.Request(destination, |
136 is_https_, | 141 is_https_, |
137 privacy_mode_, | 142 privacy_mode_, |
138 "GET", | 143 "GET", |
139 net_log_, | 144 net_log_, |
140 callback_.callback())); | 145 callback_.callback())); |
141 | 146 |
142 EXPECT_EQ(OK, callback_.WaitForResult()); | 147 EXPECT_EQ(OK, callback_.WaitForResult()); |
143 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 148 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
144 EXPECT_TRUE(stream.get()); | 149 EXPECT_TRUE(stream.get()); |
145 stream.reset(); | 150 stream.reset(); |
146 | 151 |
147 QuicClientSession* session = QuicStreamFactoryPeer::GetActiveSession( | 152 QuicClientSession* session = QuicStreamFactoryPeer::GetActiveSession( |
148 &factory_, destination, is_https_); | 153 &factory_, destination, is_https_); |
149 | 154 |
150 if (socket_count + 1 != socket_factory_.udp_client_sockets().size()) { | 155 if (socket_count + 1 != socket_factory_.udp_client_sockets().size()) { |
151 EXPECT_TRUE(false); | 156 EXPECT_TRUE(false); |
152 return 0; | 157 return 0; |
153 } | 158 } |
154 | 159 |
155 IPEndPoint endpoint; | 160 IPEndPoint endpoint; |
156 socket_factory_. | 161 socket_factory_.udp_client_sockets()[socket_count]->GetLocalAddress( |
157 udp_client_sockets()[socket_count]->GetLocalAddress(&endpoint); | 162 &endpoint); |
158 int port = endpoint.port(); | 163 int port = endpoint.port(); |
159 if (goaway_received) { | 164 if (goaway_received) { |
160 QuicGoAwayFrame goaway(QUIC_NO_ERROR, 1, ""); | 165 QuicGoAwayFrame goaway(QUIC_NO_ERROR, 1, ""); |
161 session->OnGoAway(goaway); | 166 session->OnGoAway(goaway); |
162 } | 167 } |
163 | 168 |
164 factory_.OnSessionClosed(session); | 169 factory_.OnSessionClosed(session); |
165 EXPECT_EQ(NULL, CreateIfSessionExists(destination, net_log_).get()); | 170 EXPECT_EQ(NULL, CreateIfSessionExists(destination, net_log_).get()); |
166 EXPECT_TRUE(socket_data.at_read_eof()); | 171 EXPECT_TRUE(socket_data.at_read_eof()); |
167 EXPECT_TRUE(socket_data.at_write_eof()); | 172 EXPECT_TRUE(socket_data.at_write_eof()); |
168 return port; | 173 return port; |
169 } | 174 } |
170 | 175 |
171 scoped_ptr<QuicEncryptedPacket> ConstructRstPacket() { | 176 scoped_ptr<QuicEncryptedPacket> ConstructRstPacket() { |
172 QuicStreamId stream_id = 5; | 177 QuicStreamId stream_id = 5; |
173 return maker_.MakeRstPacket( | 178 return maker_.MakeRstPacket( |
174 1, true, stream_id, | 179 1, |
| 180 true, |
| 181 stream_id, |
175 AdjustErrorForVersion(QUIC_RST_FLOW_CONTROL_ACCOUNTING, GetParam())); | 182 AdjustErrorForVersion(QUIC_RST_FLOW_CONTROL_ACCOUNTING, GetParam())); |
176 } | 183 } |
177 | 184 |
178 MockHostResolver host_resolver_; | 185 MockHostResolver host_resolver_; |
179 DeterministicMockClientSocketFactory socket_factory_; | 186 DeterministicMockClientSocketFactory socket_factory_; |
180 MockCryptoClientStreamFactory crypto_client_stream_factory_; | 187 MockCryptoClientStreamFactory crypto_client_stream_factory_; |
181 MockRandom random_generator_; | 188 MockRandom random_generator_; |
182 QuicTestPacketMaker maker_; | 189 QuicTestPacketMaker maker_; |
183 MockClock* clock_; // Owned by factory_. | 190 MockClock* clock_; // Owned by factory_. |
184 scoped_ptr<CertVerifier> cert_verifier_; | 191 scoped_ptr<CertVerifier> cert_verifier_; |
185 QuicStreamFactory factory_; | 192 QuicStreamFactory factory_; |
186 HostPortPair host_port_pair_; | 193 HostPortPair host_port_pair_; |
187 bool is_https_; | 194 bool is_https_; |
188 PrivacyMode privacy_mode_; | 195 PrivacyMode privacy_mode_; |
189 BoundNetLog net_log_; | 196 BoundNetLog net_log_; |
190 TestCompletionCallback callback_; | 197 TestCompletionCallback callback_; |
191 }; | 198 }; |
192 | 199 |
193 INSTANTIATE_TEST_CASE_P(Version, QuicStreamFactoryTest, | 200 INSTANTIATE_TEST_CASE_P(Version, |
| 201 QuicStreamFactoryTest, |
194 ::testing::ValuesIn(QuicSupportedVersions())); | 202 ::testing::ValuesIn(QuicSupportedVersions())); |
195 | 203 |
196 TEST_P(QuicStreamFactoryTest, CreateIfSessionExists) { | 204 TEST_P(QuicStreamFactoryTest, CreateIfSessionExists) { |
197 EXPECT_EQ(NULL, CreateIfSessionExists(host_port_pair_, net_log_).get()); | 205 EXPECT_EQ(NULL, CreateIfSessionExists(host_port_pair_, net_log_).get()); |
198 } | 206 } |
199 | 207 |
200 TEST_P(QuicStreamFactoryTest, Create) { | 208 TEST_P(QuicStreamFactoryTest, Create) { |
201 MockRead reads[] = { | 209 MockRead reads[] = { |
202 MockRead(ASYNC, OK, 0) // EOF | 210 MockRead(ASYNC, OK, 0) // EOF |
203 }; | 211 }; |
204 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 212 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
205 socket_factory_.AddSocketDataProvider(&socket_data); | 213 socket_factory_.AddSocketDataProvider(&socket_data); |
206 socket_data.StopAfter(1); | 214 socket_data.StopAfter(1); |
207 | 215 |
208 QuicStreamRequest request(&factory_); | 216 QuicStreamRequest request(&factory_); |
209 EXPECT_EQ(ERR_IO_PENDING, | 217 EXPECT_EQ(ERR_IO_PENDING, |
210 request.Request(host_port_pair_, | 218 request.Request(host_port_pair_, |
211 is_https_, | 219 is_https_, |
212 privacy_mode_, | 220 privacy_mode_, |
(...skipping 13 matching lines...) Expand all Loading... |
226 // in streams on different sessions. | 234 // in streams on different sessions. |
227 QuicStreamRequest request2(&factory_); | 235 QuicStreamRequest request2(&factory_); |
228 EXPECT_EQ(OK, | 236 EXPECT_EQ(OK, |
229 request2.Request(host_port_pair_, | 237 request2.Request(host_port_pair_, |
230 is_https_, | 238 is_https_, |
231 privacy_mode_, | 239 privacy_mode_, |
232 "GET", | 240 "GET", |
233 net_log_, | 241 net_log_, |
234 callback_.callback())); | 242 callback_.callback())); |
235 stream = request2.ReleaseStream(); // Will reset stream 5. | 243 stream = request2.ReleaseStream(); // Will reset stream 5. |
236 stream.reset(); // Will reset stream 7. | 244 stream.reset(); // Will reset stream 7. |
237 | 245 |
238 EXPECT_TRUE(socket_data.at_read_eof()); | 246 EXPECT_TRUE(socket_data.at_read_eof()); |
239 EXPECT_TRUE(socket_data.at_write_eof()); | 247 EXPECT_TRUE(socket_data.at_write_eof()); |
240 } | 248 } |
241 | 249 |
242 TEST_P(QuicStreamFactoryTest, CreateZeroRtt) { | 250 TEST_P(QuicStreamFactoryTest, CreateZeroRtt) { |
243 MockRead reads[] = { | 251 MockRead reads[] = { |
244 MockRead(ASYNC, OK, 0) // EOF | 252 MockRead(ASYNC, OK, 0) // EOF |
245 }; | 253 }; |
246 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 254 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
247 socket_factory_.AddSocketDataProvider(&socket_data); | 255 socket_factory_.AddSocketDataProvider(&socket_data); |
248 socket_data.StopAfter(1); | 256 socket_data.StopAfter(1); |
249 | 257 |
250 crypto_client_stream_factory_.set_handshake_mode( | 258 crypto_client_stream_factory_.set_handshake_mode( |
251 MockCryptoClientStream::ZERO_RTT); | 259 MockCryptoClientStream::ZERO_RTT); |
252 host_resolver_.set_synchronous_mode(true); | 260 host_resolver_.set_synchronous_mode(true); |
253 host_resolver_.rules()->AddIPLiteralRule(host_port_pair_.host(), | 261 host_resolver_.rules()->AddIPLiteralRule( |
254 "192.168.0.1", ""); | 262 host_port_pair_.host(), "192.168.0.1", ""); |
255 | 263 |
256 QuicStreamRequest request(&factory_); | 264 QuicStreamRequest request(&factory_); |
257 EXPECT_EQ(OK, | 265 EXPECT_EQ(OK, |
258 request.Request(host_port_pair_, | 266 request.Request(host_port_pair_, |
259 is_https_, | 267 is_https_, |
260 privacy_mode_, | 268 privacy_mode_, |
261 "GET", | 269 "GET", |
262 net_log_, | 270 net_log_, |
263 callback_.callback())); | 271 callback_.callback())); |
264 | 272 |
265 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 273 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
266 EXPECT_TRUE(stream.get()); | 274 EXPECT_TRUE(stream.get()); |
267 EXPECT_TRUE(socket_data.at_read_eof()); | 275 EXPECT_TRUE(socket_data.at_read_eof()); |
268 EXPECT_TRUE(socket_data.at_write_eof()); | 276 EXPECT_TRUE(socket_data.at_write_eof()); |
269 } | 277 } |
270 | 278 |
271 TEST_P(QuicStreamFactoryTest, CreateZeroRttPost) { | 279 TEST_P(QuicStreamFactoryTest, CreateZeroRttPost) { |
272 MockRead reads[] = { | 280 MockRead reads[] = { |
273 MockRead(ASYNC, OK, 0) // EOF | 281 MockRead(ASYNC, OK, 0) // EOF |
274 }; | 282 }; |
275 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 283 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
276 socket_factory_.AddSocketDataProvider(&socket_data); | 284 socket_factory_.AddSocketDataProvider(&socket_data); |
277 socket_data.StopAfter(1); | 285 socket_data.StopAfter(1); |
278 | 286 |
279 crypto_client_stream_factory_.set_handshake_mode( | 287 crypto_client_stream_factory_.set_handshake_mode( |
280 MockCryptoClientStream::ZERO_RTT); | 288 MockCryptoClientStream::ZERO_RTT); |
281 host_resolver_.set_synchronous_mode(true); | 289 host_resolver_.set_synchronous_mode(true); |
282 host_resolver_.rules()->AddIPLiteralRule(host_port_pair_.host(), | 290 host_resolver_.rules()->AddIPLiteralRule( |
283 "192.168.0.1", ""); | 291 host_port_pair_.host(), "192.168.0.1", ""); |
284 | 292 |
285 QuicStreamRequest request(&factory_); | 293 QuicStreamRequest request(&factory_); |
286 // Posts require handshake confirmation, so this will return asynchronously. | 294 // Posts require handshake confirmation, so this will return asynchronously. |
287 EXPECT_EQ(ERR_IO_PENDING, | 295 EXPECT_EQ(ERR_IO_PENDING, |
288 request.Request(host_port_pair_, | 296 request.Request(host_port_pair_, |
289 is_https_, | 297 is_https_, |
290 privacy_mode_, | 298 privacy_mode_, |
291 "POST", | 299 "POST", |
292 net_log_, | 300 net_log_, |
293 callback_.callback())); | 301 callback_.callback())); |
294 | 302 |
295 // Confirm the handshake and verify that the stream is created. | 303 // Confirm the handshake and verify that the stream is created. |
296 crypto_client_stream_factory_.last_stream()->SendOnCryptoHandshakeEvent( | 304 crypto_client_stream_factory_.last_stream()->SendOnCryptoHandshakeEvent( |
297 QuicSession::HANDSHAKE_CONFIRMED); | 305 QuicSession::HANDSHAKE_CONFIRMED); |
298 | 306 |
299 EXPECT_EQ(OK, callback_.WaitForResult()); | 307 EXPECT_EQ(OK, callback_.WaitForResult()); |
300 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 308 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
301 EXPECT_TRUE(stream.get()); | 309 EXPECT_TRUE(stream.get()); |
302 EXPECT_TRUE(socket_data.at_read_eof()); | 310 EXPECT_TRUE(socket_data.at_read_eof()); |
303 EXPECT_TRUE(socket_data.at_write_eof()); | 311 EXPECT_TRUE(socket_data.at_write_eof()); |
304 } | 312 } |
305 | 313 |
306 TEST_P(QuicStreamFactoryTest, CreateHttpVsHttps) { | 314 TEST_P(QuicStreamFactoryTest, CreateHttpVsHttps) { |
307 MockRead reads[] = { | 315 MockRead reads[] = { |
308 MockRead(ASYNC, OK, 0) // EOF | 316 MockRead(ASYNC, OK, 0) // EOF |
309 }; | 317 }; |
310 DeterministicSocketData socket_data1(reads, arraysize(reads), NULL, 0); | 318 DeterministicSocketData socket_data1(reads, arraysize(reads), NULL, 0); |
311 DeterministicSocketData socket_data2(reads, arraysize(reads), NULL, 0); | 319 DeterministicSocketData socket_data2(reads, arraysize(reads), NULL, 0); |
312 socket_factory_.AddSocketDataProvider(&socket_data1); | 320 socket_factory_.AddSocketDataProvider(&socket_data1); |
313 socket_factory_.AddSocketDataProvider(&socket_data2); | 321 socket_factory_.AddSocketDataProvider(&socket_data2); |
314 socket_data1.StopAfter(1); | 322 socket_data1.StopAfter(1); |
315 socket_data2.StopAfter(1); | 323 socket_data2.StopAfter(1); |
316 | 324 |
317 QuicStreamRequest request(&factory_); | 325 QuicStreamRequest request(&factory_); |
318 EXPECT_EQ(ERR_IO_PENDING, | 326 EXPECT_EQ(ERR_IO_PENDING, |
(...skipping 27 matching lines...) Expand all Loading... |
346 &factory_, host_port_pair_, !is_https_)); | 354 &factory_, host_port_pair_, !is_https_)); |
347 | 355 |
348 EXPECT_TRUE(socket_data1.at_read_eof()); | 356 EXPECT_TRUE(socket_data1.at_read_eof()); |
349 EXPECT_TRUE(socket_data1.at_write_eof()); | 357 EXPECT_TRUE(socket_data1.at_write_eof()); |
350 EXPECT_TRUE(socket_data2.at_read_eof()); | 358 EXPECT_TRUE(socket_data2.at_read_eof()); |
351 EXPECT_TRUE(socket_data2.at_write_eof()); | 359 EXPECT_TRUE(socket_data2.at_write_eof()); |
352 } | 360 } |
353 | 361 |
354 TEST_P(QuicStreamFactoryTest, Pooling) { | 362 TEST_P(QuicStreamFactoryTest, Pooling) { |
355 MockRead reads[] = { | 363 MockRead reads[] = { |
356 MockRead(ASYNC, OK, 0) // EOF | 364 MockRead(ASYNC, OK, 0) // EOF |
357 }; | 365 }; |
358 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 366 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
359 socket_factory_.AddSocketDataProvider(&socket_data); | 367 socket_factory_.AddSocketDataProvider(&socket_data); |
360 socket_data.StopAfter(1); | 368 socket_data.StopAfter(1); |
361 | 369 |
362 HostPortPair server2("mail.google.com", kDefaultServerPort); | 370 HostPortPair server2("mail.google.com", kDefaultServerPort); |
363 host_resolver_.set_synchronous_mode(true); | 371 host_resolver_.set_synchronous_mode(true); |
364 host_resolver_.rules()->AddIPLiteralRule( | 372 host_resolver_.rules()->AddIPLiteralRule( |
365 kDefaultServerHostName, "192.168.0.1", ""); | 373 kDefaultServerHostName, "192.168.0.1", ""); |
366 host_resolver_.rules()->AddIPLiteralRule( | 374 host_resolver_.rules()->AddIPLiteralRule( |
(...skipping 26 matching lines...) Expand all Loading... |
393 QuicStreamFactoryPeer::GetActiveSession( | 401 QuicStreamFactoryPeer::GetActiveSession( |
394 &factory_, host_port_pair_, is_https_), | 402 &factory_, host_port_pair_, is_https_), |
395 QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_)); | 403 QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_)); |
396 | 404 |
397 EXPECT_TRUE(socket_data.at_read_eof()); | 405 EXPECT_TRUE(socket_data.at_read_eof()); |
398 EXPECT_TRUE(socket_data.at_write_eof()); | 406 EXPECT_TRUE(socket_data.at_write_eof()); |
399 } | 407 } |
400 | 408 |
401 TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) { | 409 TEST_P(QuicStreamFactoryTest, NoPoolingAfterGoAway) { |
402 MockRead reads[] = { | 410 MockRead reads[] = { |
403 MockRead(ASYNC, OK, 0) // EOF | 411 MockRead(ASYNC, OK, 0) // EOF |
404 }; | 412 }; |
405 DeterministicSocketData socket_data1(reads, arraysize(reads), NULL, 0); | 413 DeterministicSocketData socket_data1(reads, arraysize(reads), NULL, 0); |
406 DeterministicSocketData socket_data2(reads, arraysize(reads), NULL, 0); | 414 DeterministicSocketData socket_data2(reads, arraysize(reads), NULL, 0); |
407 socket_factory_.AddSocketDataProvider(&socket_data1); | 415 socket_factory_.AddSocketDataProvider(&socket_data1); |
408 socket_factory_.AddSocketDataProvider(&socket_data2); | 416 socket_factory_.AddSocketDataProvider(&socket_data2); |
409 socket_data1.StopAfter(1); | 417 socket_data1.StopAfter(1); |
410 socket_data2.StopAfter(1); | 418 socket_data2.StopAfter(1); |
411 | 419 |
412 HostPortPair server2("mail.google.com", kDefaultServerPort); | 420 HostPortPair server2("mail.google.com", kDefaultServerPort); |
413 host_resolver_.set_synchronous_mode(true); | 421 host_resolver_.set_synchronous_mode(true); |
(...skipping 22 matching lines...) Expand all Loading... |
436 "GET", | 444 "GET", |
437 net_log_, | 445 net_log_, |
438 callback.callback())); | 446 callback.callback())); |
439 scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream(); | 447 scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream(); |
440 EXPECT_TRUE(stream2.get()); | 448 EXPECT_TRUE(stream2.get()); |
441 | 449 |
442 factory_.OnSessionGoingAway(QuicStreamFactoryPeer::GetActiveSession( | 450 factory_.OnSessionGoingAway(QuicStreamFactoryPeer::GetActiveSession( |
443 &factory_, host_port_pair_, is_https_)); | 451 &factory_, host_port_pair_, is_https_)); |
444 EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession( | 452 EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession( |
445 &factory_, host_port_pair_, is_https_)); | 453 &factory_, host_port_pair_, is_https_)); |
446 EXPECT_FALSE(QuicStreamFactoryPeer::HasActiveSession( | 454 EXPECT_FALSE( |
447 &factory_, server2, is_https_)); | 455 QuicStreamFactoryPeer::HasActiveSession(&factory_, server2, is_https_)); |
448 | 456 |
449 TestCompletionCallback callback3; | 457 TestCompletionCallback callback3; |
450 QuicStreamRequest request3(&factory_); | 458 QuicStreamRequest request3(&factory_); |
451 EXPECT_EQ(OK, | 459 EXPECT_EQ(OK, |
452 request3.Request(server2, | 460 request3.Request(server2, |
453 is_https_, | 461 is_https_, |
454 privacy_mode_, | 462 privacy_mode_, |
455 "GET", | 463 "GET", |
456 net_log_, | 464 net_log_, |
457 callback3.callback())); | 465 callback3.callback())); |
458 scoped_ptr<QuicHttpStream> stream3 = request3.ReleaseStream(); | 466 scoped_ptr<QuicHttpStream> stream3 = request3.ReleaseStream(); |
459 EXPECT_TRUE(stream3.get()); | 467 EXPECT_TRUE(stream3.get()); |
460 | 468 |
461 EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession( | 469 EXPECT_TRUE( |
462 &factory_, server2, is_https_)); | 470 QuicStreamFactoryPeer::HasActiveSession(&factory_, server2, is_https_)); |
463 | 471 |
464 EXPECT_TRUE(socket_data1.at_read_eof()); | 472 EXPECT_TRUE(socket_data1.at_read_eof()); |
465 EXPECT_TRUE(socket_data1.at_write_eof()); | 473 EXPECT_TRUE(socket_data1.at_write_eof()); |
466 EXPECT_TRUE(socket_data2.at_read_eof()); | 474 EXPECT_TRUE(socket_data2.at_read_eof()); |
467 EXPECT_TRUE(socket_data2.at_write_eof()); | 475 EXPECT_TRUE(socket_data2.at_write_eof()); |
468 } | 476 } |
469 | 477 |
470 TEST_P(QuicStreamFactoryTest, HttpsPooling) { | 478 TEST_P(QuicStreamFactoryTest, HttpsPooling) { |
471 MockRead reads[] = { | 479 MockRead reads[] = { |
472 MockRead(ASYNC, OK, 0) // EOF | 480 MockRead(ASYNC, OK, 0) // EOF |
473 }; | 481 }; |
474 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 482 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
475 socket_factory_.AddSocketDataProvider(&socket_data); | 483 socket_factory_.AddSocketDataProvider(&socket_data); |
476 socket_data.StopAfter(1); | 484 socket_data.StopAfter(1); |
477 | 485 |
478 HostPortPair server1("www.example.org", 443); | 486 HostPortPair server1("www.example.org", 443); |
479 HostPortPair server2("mail.example.org", 443); | 487 HostPortPair server2("mail.example.org", 443); |
480 | 488 |
481 // Load a cert that is valid for: | 489 // Load a cert that is valid for: |
482 // www.example.org (server1) | 490 // www.example.org (server1) |
(...skipping 28 matching lines...) Expand all Loading... |
511 EXPECT_EQ(OK, | 519 EXPECT_EQ(OK, |
512 request2.Request(server2, | 520 request2.Request(server2, |
513 is_https_, | 521 is_https_, |
514 privacy_mode_, | 522 privacy_mode_, |
515 "GET", | 523 "GET", |
516 net_log_, | 524 net_log_, |
517 callback_.callback())); | 525 callback_.callback())); |
518 scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream(); | 526 scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream(); |
519 EXPECT_TRUE(stream2.get()); | 527 EXPECT_TRUE(stream2.get()); |
520 | 528 |
521 EXPECT_EQ(QuicStreamFactoryPeer::GetActiveSession( | 529 EXPECT_EQ( |
522 &factory_, server1, is_https_), | 530 QuicStreamFactoryPeer::GetActiveSession(&factory_, server1, is_https_), |
523 QuicStreamFactoryPeer::GetActiveSession( | 531 QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_)); |
524 &factory_, server2, is_https_)); | |
525 | 532 |
526 EXPECT_TRUE(socket_data.at_read_eof()); | 533 EXPECT_TRUE(socket_data.at_read_eof()); |
527 EXPECT_TRUE(socket_data.at_write_eof()); | 534 EXPECT_TRUE(socket_data.at_write_eof()); |
528 } | 535 } |
529 | 536 |
530 TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithCertMismatch) { | 537 TEST_P(QuicStreamFactoryTest, NoHttpsPoolingWithCertMismatch) { |
531 MockRead reads[] = { | 538 MockRead reads[] = { |
532 MockRead(ASYNC, OK, 0) // EOF | 539 MockRead(ASYNC, OK, 0) // EOF |
533 }; | 540 }; |
534 DeterministicSocketData socket_data1(reads, arraysize(reads), NULL, 0); | 541 DeterministicSocketData socket_data1(reads, arraysize(reads), NULL, 0); |
535 DeterministicSocketData socket_data2(reads, arraysize(reads), NULL, 0); | 542 DeterministicSocketData socket_data2(reads, arraysize(reads), NULL, 0); |
536 socket_factory_.AddSocketDataProvider(&socket_data1); | 543 socket_factory_.AddSocketDataProvider(&socket_data1); |
537 socket_factory_.AddSocketDataProvider(&socket_data2); | 544 socket_factory_.AddSocketDataProvider(&socket_data2); |
538 socket_data1.StopAfter(1); | 545 socket_data1.StopAfter(1); |
539 socket_data2.StopAfter(1); | 546 socket_data2.StopAfter(1); |
540 | 547 |
541 HostPortPair server1("www.example.org", 443); | 548 HostPortPair server1("www.example.org", 443); |
542 HostPortPair server2("mail.google.com", 443); | 549 HostPortPair server2("mail.google.com", 443); |
543 | 550 |
544 // Load a cert that is valid for: | 551 // Load a cert that is valid for: |
545 // www.example.org (server1) | 552 // www.example.org (server1) |
546 // mail.example.org | 553 // mail.example.org |
547 // www.example.com | 554 // www.example.com |
548 // But is not valid for mail.google.com (server2). | 555 // But is not valid for mail.google.com (server2). |
549 base::FilePath certs_dir = GetTestCertsDirectory(); | 556 base::FilePath certs_dir = GetTestCertsDirectory(); |
550 scoped_refptr<X509Certificate> test_cert( | 557 scoped_refptr<X509Certificate> test_cert( |
551 ImportCertFromFile(certs_dir, "spdy_pooling.pem")); | 558 ImportCertFromFile(certs_dir, "spdy_pooling.pem")); |
552 ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); | 559 ASSERT_NE(static_cast<X509Certificate*>(NULL), test_cert); |
553 ProofVerifyDetailsChromium verify_details; | 560 ProofVerifyDetailsChromium verify_details; |
554 verify_details.cert_verify_result.verified_cert = test_cert; | 561 verify_details.cert_verify_result.verified_cert = test_cert; |
555 crypto_client_stream_factory_.set_proof_verify_details(&verify_details); | 562 crypto_client_stream_factory_.set_proof_verify_details(&verify_details); |
556 | 563 |
557 | |
558 host_resolver_.set_synchronous_mode(true); | 564 host_resolver_.set_synchronous_mode(true); |
559 host_resolver_.rules()->AddIPLiteralRule(server1.host(), "192.168.0.1", ""); | 565 host_resolver_.rules()->AddIPLiteralRule(server1.host(), "192.168.0.1", ""); |
560 host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", ""); | 566 host_resolver_.rules()->AddIPLiteralRule(server2.host(), "192.168.0.1", ""); |
561 | 567 |
562 QuicStreamRequest request(&factory_); | 568 QuicStreamRequest request(&factory_); |
563 is_https_ = true; | 569 is_https_ = true; |
564 EXPECT_EQ(OK, | 570 EXPECT_EQ(OK, |
565 request.Request(server1, | 571 request.Request(server1, |
566 is_https_, | 572 is_https_, |
567 privacy_mode_, | 573 privacy_mode_, |
568 "GET", | 574 "GET", |
569 net_log_, | 575 net_log_, |
570 callback_.callback())); | 576 callback_.callback())); |
571 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 577 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
572 EXPECT_TRUE(stream.get()); | 578 EXPECT_TRUE(stream.get()); |
573 | 579 |
574 TestCompletionCallback callback; | 580 TestCompletionCallback callback; |
575 QuicStreamRequest request2(&factory_); | 581 QuicStreamRequest request2(&factory_); |
576 EXPECT_EQ(OK, | 582 EXPECT_EQ(OK, |
577 request2.Request(server2, | 583 request2.Request(server2, |
578 is_https_, | 584 is_https_, |
579 privacy_mode_, | 585 privacy_mode_, |
580 "GET", | 586 "GET", |
581 net_log_, | 587 net_log_, |
582 callback_.callback())); | 588 callback_.callback())); |
583 scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream(); | 589 scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream(); |
584 EXPECT_TRUE(stream2.get()); | 590 EXPECT_TRUE(stream2.get()); |
585 | 591 |
586 EXPECT_NE(QuicStreamFactoryPeer::GetActiveSession( | 592 EXPECT_NE( |
587 &factory_, server1, is_https_), | 593 QuicStreamFactoryPeer::GetActiveSession(&factory_, server1, is_https_), |
588 QuicStreamFactoryPeer::GetActiveSession( | 594 QuicStreamFactoryPeer::GetActiveSession(&factory_, server2, is_https_)); |
589 &factory_, server2, is_https_)); | |
590 | 595 |
591 EXPECT_TRUE(socket_data1.at_read_eof()); | 596 EXPECT_TRUE(socket_data1.at_read_eof()); |
592 EXPECT_TRUE(socket_data1.at_write_eof()); | 597 EXPECT_TRUE(socket_data1.at_write_eof()); |
593 EXPECT_TRUE(socket_data2.at_read_eof()); | 598 EXPECT_TRUE(socket_data2.at_read_eof()); |
594 EXPECT_TRUE(socket_data2.at_write_eof()); | 599 EXPECT_TRUE(socket_data2.at_write_eof()); |
595 } | 600 } |
596 | 601 |
597 TEST_P(QuicStreamFactoryTest, Goaway) { | 602 TEST_P(QuicStreamFactoryTest, Goaway) { |
598 MockRead reads[] = { | 603 MockRead reads[] = { |
599 MockRead(ASYNC, OK, 0) // EOF | 604 MockRead(ASYNC, OK, 0) // EOF |
600 }; | 605 }; |
601 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 606 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
602 socket_data.StopAfter(1); | 607 socket_data.StopAfter(1); |
603 socket_factory_.AddSocketDataProvider(&socket_data); | 608 socket_factory_.AddSocketDataProvider(&socket_data); |
604 DeterministicSocketData socket_data2(reads, arraysize(reads), NULL, 0); | 609 DeterministicSocketData socket_data2(reads, arraysize(reads), NULL, 0); |
605 socket_data2.StopAfter(1); | 610 socket_data2.StopAfter(1); |
606 socket_factory_.AddSocketDataProvider(&socket_data2); | 611 socket_factory_.AddSocketDataProvider(&socket_data2); |
607 | 612 |
608 QuicStreamRequest request(&factory_); | 613 QuicStreamRequest request(&factory_); |
609 EXPECT_EQ(ERR_IO_PENDING, | 614 EXPECT_EQ(ERR_IO_PENDING, |
(...skipping 25 matching lines...) Expand all Loading... |
635 request2.Request(host_port_pair_, | 640 request2.Request(host_port_pair_, |
636 is_https_, | 641 is_https_, |
637 privacy_mode_, | 642 privacy_mode_, |
638 "GET", | 643 "GET", |
639 net_log_, | 644 net_log_, |
640 callback_.callback())); | 645 callback_.callback())); |
641 EXPECT_EQ(OK, callback_.WaitForResult()); | 646 EXPECT_EQ(OK, callback_.WaitForResult()); |
642 scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream(); | 647 scoped_ptr<QuicHttpStream> stream2 = request2.ReleaseStream(); |
643 EXPECT_TRUE(stream2.get()); | 648 EXPECT_TRUE(stream2.get()); |
644 | 649 |
645 EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession(&factory_, | 650 EXPECT_TRUE(QuicStreamFactoryPeer::HasActiveSession( |
646 host_port_pair_, | 651 &factory_, host_port_pair_, is_https_)); |
647 is_https_)); | |
648 EXPECT_NE(session, | 652 EXPECT_NE(session, |
649 QuicStreamFactoryPeer::GetActiveSession( | 653 QuicStreamFactoryPeer::GetActiveSession( |
650 &factory_, host_port_pair_, is_https_)); | 654 &factory_, host_port_pair_, is_https_)); |
651 EXPECT_EQ(true, QuicStreamFactoryPeer::IsLiveSession(&factory_, session)); | 655 EXPECT_EQ(true, QuicStreamFactoryPeer::IsLiveSession(&factory_, session)); |
652 | 656 |
653 stream2.reset(); | 657 stream2.reset(); |
654 stream.reset(); | 658 stream.reset(); |
655 | 659 |
656 EXPECT_TRUE(socket_data.at_read_eof()); | 660 EXPECT_TRUE(socket_data.at_read_eof()); |
657 EXPECT_TRUE(socket_data.at_write_eof()); | 661 EXPECT_TRUE(socket_data.at_write_eof()); |
658 EXPECT_TRUE(socket_data2.at_read_eof()); | 662 EXPECT_TRUE(socket_data2.at_read_eof()); |
659 EXPECT_TRUE(socket_data2.at_write_eof()); | 663 EXPECT_TRUE(socket_data2.at_write_eof()); |
660 } | 664 } |
661 | 665 |
662 TEST_P(QuicStreamFactoryTest, MaxOpenStream) { | 666 TEST_P(QuicStreamFactoryTest, MaxOpenStream) { |
663 MockRead reads[] = { | 667 MockRead reads[] = { |
664 MockRead(ASYNC, OK, 0) // EOF | 668 MockRead(ASYNC, OK, 0) // EOF |
665 }; | 669 }; |
666 QuicStreamId stream_id = 5; | 670 QuicStreamId stream_id = 5; |
667 scoped_ptr<QuicEncryptedPacket> rst( | 671 scoped_ptr<QuicEncryptedPacket> rst( |
668 maker_.MakeRstPacket(1, true, stream_id, QUIC_STREAM_CANCELLED)); | 672 maker_.MakeRstPacket(1, true, stream_id, QUIC_STREAM_CANCELLED)); |
669 MockWrite writes[] = { | 673 MockWrite writes[] = { |
670 MockWrite(ASYNC, rst->data(), rst->length(), 1), | 674 MockWrite(ASYNC, rst->data(), rst->length(), 1), |
671 }; | 675 }; |
672 DeterministicSocketData socket_data(reads, arraysize(reads), | 676 DeterministicSocketData socket_data( |
673 writes, arraysize(writes)); | 677 reads, arraysize(reads), writes, arraysize(writes)); |
674 socket_factory_.AddSocketDataProvider(&socket_data); | 678 socket_factory_.AddSocketDataProvider(&socket_data); |
675 socket_data.StopAfter(1); | 679 socket_data.StopAfter(1); |
676 | 680 |
677 HttpRequestInfo request_info; | 681 HttpRequestInfo request_info; |
678 std::vector<QuicHttpStream*> streams; | 682 std::vector<QuicHttpStream*> streams; |
679 // The MockCryptoClientStream sets max_open_streams to be | 683 // The MockCryptoClientStream sets max_open_streams to be |
680 // 2 * kDefaultMaxStreamsPerConnection. | 684 // 2 * kDefaultMaxStreamsPerConnection. |
681 for (size_t i = 0; i < 2 * kDefaultMaxStreamsPerConnection; i++) { | 685 for (size_t i = 0; i < 2 * kDefaultMaxStreamsPerConnection; i++) { |
682 QuicStreamRequest request(&factory_); | 686 QuicStreamRequest request(&factory_); |
683 int rv = request.Request(host_port_pair_, | 687 int rv = request.Request(host_port_pair_, |
684 is_https_, | 688 is_https_, |
685 privacy_mode_, | 689 privacy_mode_, |
686 "GET", | 690 "GET", |
687 net_log_, | 691 net_log_, |
688 callback_.callback()); | 692 callback_.callback()); |
689 if (i == 0) { | 693 if (i == 0) { |
690 EXPECT_EQ(ERR_IO_PENDING, rv); | 694 EXPECT_EQ(ERR_IO_PENDING, rv); |
691 EXPECT_EQ(OK, callback_.WaitForResult()); | 695 EXPECT_EQ(OK, callback_.WaitForResult()); |
692 } else { | 696 } else { |
693 EXPECT_EQ(OK, rv); | 697 EXPECT_EQ(OK, rv); |
694 } | 698 } |
695 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 699 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
696 EXPECT_TRUE(stream); | 700 EXPECT_TRUE(stream); |
697 EXPECT_EQ(OK, stream->InitializeStream( | 701 EXPECT_EQ( |
698 &request_info, DEFAULT_PRIORITY, net_log_, CompletionCallback())); | 702 OK, |
| 703 stream->InitializeStream( |
| 704 &request_info, DEFAULT_PRIORITY, net_log_, CompletionCallback())); |
699 streams.push_back(stream.release()); | 705 streams.push_back(stream.release()); |
700 } | 706 } |
701 | 707 |
702 QuicStreamRequest request(&factory_); | 708 QuicStreamRequest request(&factory_); |
703 EXPECT_EQ(OK, | 709 EXPECT_EQ(OK, |
704 request.Request(host_port_pair_, | 710 request.Request(host_port_pair_, |
705 is_https_, | 711 is_https_, |
706 privacy_mode_, | 712 privacy_mode_, |
707 "GET", | 713 "GET", |
708 net_log_, | 714 net_log_, |
709 CompletionCallback())); | 715 CompletionCallback())); |
710 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 716 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
711 EXPECT_TRUE(stream); | 717 EXPECT_TRUE(stream); |
712 EXPECT_EQ(ERR_IO_PENDING, stream->InitializeStream( | 718 EXPECT_EQ( |
713 &request_info, DEFAULT_PRIORITY, net_log_, callback_.callback())); | 719 ERR_IO_PENDING, |
| 720 stream->InitializeStream( |
| 721 &request_info, DEFAULT_PRIORITY, net_log_, callback_.callback())); |
714 | 722 |
715 // Close the first stream. | 723 // Close the first stream. |
716 streams.front()->Close(false); | 724 streams.front()->Close(false); |
717 | 725 |
718 ASSERT_TRUE(callback_.have_result()); | 726 ASSERT_TRUE(callback_.have_result()); |
719 | 727 |
720 EXPECT_EQ(OK, callback_.WaitForResult()); | 728 EXPECT_EQ(OK, callback_.WaitForResult()); |
721 | 729 |
722 EXPECT_TRUE(socket_data.at_read_eof()); | 730 EXPECT_TRUE(socket_data.at_read_eof()); |
723 EXPECT_TRUE(socket_data.at_write_eof()); | 731 EXPECT_TRUE(socket_data.at_write_eof()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 callback_.callback())); | 770 callback_.callback())); |
763 | 771 |
764 EXPECT_EQ(ERR_ADDRESS_IN_USE, callback_.WaitForResult()); | 772 EXPECT_EQ(ERR_ADDRESS_IN_USE, callback_.WaitForResult()); |
765 | 773 |
766 EXPECT_TRUE(socket_data.at_read_eof()); | 774 EXPECT_TRUE(socket_data.at_read_eof()); |
767 EXPECT_TRUE(socket_data.at_write_eof()); | 775 EXPECT_TRUE(socket_data.at_write_eof()); |
768 } | 776 } |
769 | 777 |
770 TEST_P(QuicStreamFactoryTest, CancelCreate) { | 778 TEST_P(QuicStreamFactoryTest, CancelCreate) { |
771 MockRead reads[] = { | 779 MockRead reads[] = { |
772 MockRead(ASYNC, OK, 0) // EOF | 780 MockRead(ASYNC, OK, 0) // EOF |
773 }; | 781 }; |
774 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); | 782 DeterministicSocketData socket_data(reads, arraysize(reads), NULL, 0); |
775 socket_factory_.AddSocketDataProvider(&socket_data); | 783 socket_factory_.AddSocketDataProvider(&socket_data); |
776 { | 784 { |
777 QuicStreamRequest request(&factory_); | 785 QuicStreamRequest request(&factory_); |
778 EXPECT_EQ(ERR_IO_PENDING, | 786 EXPECT_EQ(ERR_IO_PENDING, |
779 request.Request(host_port_pair_, | 787 request.Request(host_port_pair_, |
780 is_https_, | 788 is_https_, |
781 privacy_mode_, | 789 privacy_mode_, |
782 "GET", | 790 "GET", |
(...skipping 23 matching lines...) Expand all Loading... |
806 EXPECT_NE(kDefaultServerHostName, other_server_name); | 814 EXPECT_NE(kDefaultServerHostName, other_server_name); |
807 HostPortPair host_port_pair2(other_server_name, kDefaultServerPort); | 815 HostPortPair host_port_pair2(other_server_name, kDefaultServerPort); |
808 | 816 |
809 int original_port = GetSourcePortForNewSession(host_port_pair_); | 817 int original_port = GetSourcePortForNewSession(host_port_pair_); |
810 EXPECT_NE(original_port, GetSourcePortForNewSession(host_port_pair2)); | 818 EXPECT_NE(original_port, GetSourcePortForNewSession(host_port_pair2)); |
811 EXPECT_EQ(original_port, GetSourcePortForNewSession(host_port_pair_)); | 819 EXPECT_EQ(original_port, GetSourcePortForNewSession(host_port_pair_)); |
812 } | 820 } |
813 | 821 |
814 TEST_P(QuicStreamFactoryTest, GoAwayDisablesConsistentEphemeralPort) { | 822 TEST_P(QuicStreamFactoryTest, GoAwayDisablesConsistentEphemeralPort) { |
815 // Get a session to the host using the port suggester. | 823 // Get a session to the host using the port suggester. |
816 int original_port = | 824 int original_port = GetSourcePortForNewSessionAndGoAway(host_port_pair_); |
817 GetSourcePortForNewSessionAndGoAway(host_port_pair_); | |
818 // Verify that the port is different after the goaway. | 825 // Verify that the port is different after the goaway. |
819 EXPECT_NE(original_port, GetSourcePortForNewSession(host_port_pair_)); | 826 EXPECT_NE(original_port, GetSourcePortForNewSession(host_port_pair_)); |
820 // Since the previous session did not goaway we should see the original port. | 827 // Since the previous session did not goaway we should see the original port. |
821 EXPECT_EQ(original_port, GetSourcePortForNewSession(host_port_pair_)); | 828 EXPECT_EQ(original_port, GetSourcePortForNewSession(host_port_pair_)); |
822 } | 829 } |
823 | 830 |
824 TEST_P(QuicStreamFactoryTest, CloseAllSessions) { | 831 TEST_P(QuicStreamFactoryTest, CloseAllSessions) { |
825 MockRead reads[] = { | 832 MockRead reads[] = { |
826 MockRead(ASYNC, 0, 0) // EOF | 833 MockRead(ASYNC, 0, 0) // EOF |
827 }; | 834 }; |
828 scoped_ptr<QuicEncryptedPacket> rst(ConstructRstPacket()); | 835 scoped_ptr<QuicEncryptedPacket> rst(ConstructRstPacket()); |
829 std::vector<MockWrite> writes; | 836 std::vector<MockWrite> writes; |
830 writes.push_back(MockWrite(ASYNC, rst->data(), rst->length(), 1)); | 837 writes.push_back(MockWrite(ASYNC, rst->data(), rst->length(), 1)); |
831 DeterministicSocketData socket_data(reads, arraysize(reads), | 838 DeterministicSocketData socket_data(reads, |
832 writes.empty() ? NULL : &writes[0], | 839 arraysize(reads), |
| 840 writes.empty() ? NULL : &writes[0], |
833 writes.size()); | 841 writes.size()); |
834 socket_factory_.AddSocketDataProvider(&socket_data); | 842 socket_factory_.AddSocketDataProvider(&socket_data); |
835 socket_data.StopAfter(1); | 843 socket_data.StopAfter(1); |
836 | 844 |
837 MockRead reads2[] = { | 845 MockRead reads2[] = { |
838 MockRead(ASYNC, 0, 0) // EOF | 846 MockRead(ASYNC, 0, 0) // EOF |
839 }; | 847 }; |
840 DeterministicSocketData socket_data2(reads2, arraysize(reads2), NULL, 0); | 848 DeterministicSocketData socket_data2(reads2, arraysize(reads2), NULL, 0); |
841 socket_factory_.AddSocketDataProvider(&socket_data2); | 849 socket_factory_.AddSocketDataProvider(&socket_data2); |
842 socket_data2.StopAfter(1); | 850 socket_data2.StopAfter(1); |
843 | 851 |
844 QuicStreamRequest request(&factory_); | 852 QuicStreamRequest request(&factory_); |
845 EXPECT_EQ(ERR_IO_PENDING, | 853 EXPECT_EQ(ERR_IO_PENDING, |
846 request.Request(host_port_pair_, | 854 request.Request(host_port_pair_, |
847 is_https_, | 855 is_https_, |
848 privacy_mode_, | 856 privacy_mode_, |
849 "GET", | 857 "GET", |
850 net_log_, | 858 net_log_, |
851 callback_.callback())); | 859 callback_.callback())); |
852 | 860 |
853 EXPECT_EQ(OK, callback_.WaitForResult()); | 861 EXPECT_EQ(OK, callback_.WaitForResult()); |
854 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 862 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
855 HttpRequestInfo request_info; | 863 HttpRequestInfo request_info; |
856 EXPECT_EQ(OK, stream->InitializeStream(&request_info, | 864 EXPECT_EQ( |
857 DEFAULT_PRIORITY, | 865 OK, |
858 net_log_, CompletionCallback())); | 866 stream->InitializeStream( |
| 867 &request_info, DEFAULT_PRIORITY, net_log_, CompletionCallback())); |
859 | 868 |
860 // Close the session and verify that stream saw the error. | 869 // Close the session and verify that stream saw the error. |
861 factory_.CloseAllSessions(ERR_INTERNET_DISCONNECTED); | 870 factory_.CloseAllSessions(ERR_INTERNET_DISCONNECTED); |
862 EXPECT_EQ(ERR_INTERNET_DISCONNECTED, | 871 EXPECT_EQ(ERR_INTERNET_DISCONNECTED, |
863 stream->ReadResponseHeaders(callback_.callback())); | 872 stream->ReadResponseHeaders(callback_.callback())); |
864 | 873 |
865 // Now attempting to request a stream to the same origin should create | 874 // Now attempting to request a stream to the same origin should create |
866 // a new session. | 875 // a new session. |
867 | 876 |
868 QuicStreamRequest request2(&factory_); | 877 QuicStreamRequest request2(&factory_); |
(...skipping 10 matching lines...) Expand all Loading... |
879 stream.reset(); // Will reset stream 3. | 888 stream.reset(); // Will reset stream 3. |
880 | 889 |
881 EXPECT_TRUE(socket_data.at_read_eof()); | 890 EXPECT_TRUE(socket_data.at_read_eof()); |
882 EXPECT_TRUE(socket_data.at_write_eof()); | 891 EXPECT_TRUE(socket_data.at_write_eof()); |
883 EXPECT_TRUE(socket_data2.at_read_eof()); | 892 EXPECT_TRUE(socket_data2.at_read_eof()); |
884 EXPECT_TRUE(socket_data2.at_write_eof()); | 893 EXPECT_TRUE(socket_data2.at_write_eof()); |
885 } | 894 } |
886 | 895 |
887 TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) { | 896 TEST_P(QuicStreamFactoryTest, OnIPAddressChanged) { |
888 MockRead reads[] = { | 897 MockRead reads[] = { |
889 MockRead(ASYNC, 0, 0) // EOF | 898 MockRead(ASYNC, 0, 0) // EOF |
890 }; | 899 }; |
891 scoped_ptr<QuicEncryptedPacket> rst(ConstructRstPacket()); | 900 scoped_ptr<QuicEncryptedPacket> rst(ConstructRstPacket()); |
892 std::vector<MockWrite> writes; | 901 std::vector<MockWrite> writes; |
893 writes.push_back(MockWrite(ASYNC, rst->data(), rst->length(), 1)); | 902 writes.push_back(MockWrite(ASYNC, rst->data(), rst->length(), 1)); |
894 DeterministicSocketData socket_data(reads, arraysize(reads), | 903 DeterministicSocketData socket_data(reads, |
895 writes.empty() ? NULL : &writes[0], | 904 arraysize(reads), |
| 905 writes.empty() ? NULL : &writes[0], |
896 writes.size()); | 906 writes.size()); |
897 socket_factory_.AddSocketDataProvider(&socket_data); | 907 socket_factory_.AddSocketDataProvider(&socket_data); |
898 socket_data.StopAfter(1); | 908 socket_data.StopAfter(1); |
899 | 909 |
900 MockRead reads2[] = { | 910 MockRead reads2[] = { |
901 MockRead(ASYNC, 0, 0) // EOF | 911 MockRead(ASYNC, 0, 0) // EOF |
902 }; | 912 }; |
903 DeterministicSocketData socket_data2(reads2, arraysize(reads2), NULL, 0); | 913 DeterministicSocketData socket_data2(reads2, arraysize(reads2), NULL, 0); |
904 socket_factory_.AddSocketDataProvider(&socket_data2); | 914 socket_factory_.AddSocketDataProvider(&socket_data2); |
905 socket_data2.StopAfter(1); | 915 socket_data2.StopAfter(1); |
906 | 916 |
907 QuicStreamRequest request(&factory_); | 917 QuicStreamRequest request(&factory_); |
908 EXPECT_EQ(ERR_IO_PENDING, | 918 EXPECT_EQ(ERR_IO_PENDING, |
909 request.Request(host_port_pair_, | 919 request.Request(host_port_pair_, |
910 is_https_, | 920 is_https_, |
911 privacy_mode_, | 921 privacy_mode_, |
912 "GET", | 922 "GET", |
913 net_log_, | 923 net_log_, |
914 callback_.callback())); | 924 callback_.callback())); |
915 | 925 |
916 EXPECT_EQ(OK, callback_.WaitForResult()); | 926 EXPECT_EQ(OK, callback_.WaitForResult()); |
917 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 927 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
918 HttpRequestInfo request_info; | 928 HttpRequestInfo request_info; |
919 EXPECT_EQ(OK, stream->InitializeStream(&request_info, | 929 EXPECT_EQ( |
920 DEFAULT_PRIORITY, | 930 OK, |
921 net_log_, CompletionCallback())); | 931 stream->InitializeStream( |
| 932 &request_info, DEFAULT_PRIORITY, net_log_, CompletionCallback())); |
922 | 933 |
923 // Change the IP address and verify that stream saw the error. | 934 // Change the IP address and verify that stream saw the error. |
924 factory_.OnIPAddressChanged(); | 935 factory_.OnIPAddressChanged(); |
925 EXPECT_EQ(ERR_NETWORK_CHANGED, | 936 EXPECT_EQ(ERR_NETWORK_CHANGED, |
926 stream->ReadResponseHeaders(callback_.callback())); | 937 stream->ReadResponseHeaders(callback_.callback())); |
927 EXPECT_TRUE(factory_.require_confirmation()); | 938 EXPECT_TRUE(factory_.require_confirmation()); |
928 | 939 |
929 // Now attempting to request a stream to the same origin should create | 940 // Now attempting to request a stream to the same origin should create |
930 // a new session. | 941 // a new session. |
931 | 942 |
(...skipping 11 matching lines...) Expand all Loading... |
943 stream.reset(); // Will reset stream 3. | 954 stream.reset(); // Will reset stream 3. |
944 | 955 |
945 EXPECT_TRUE(socket_data.at_read_eof()); | 956 EXPECT_TRUE(socket_data.at_read_eof()); |
946 EXPECT_TRUE(socket_data.at_write_eof()); | 957 EXPECT_TRUE(socket_data.at_write_eof()); |
947 EXPECT_TRUE(socket_data2.at_read_eof()); | 958 EXPECT_TRUE(socket_data2.at_read_eof()); |
948 EXPECT_TRUE(socket_data2.at_write_eof()); | 959 EXPECT_TRUE(socket_data2.at_write_eof()); |
949 } | 960 } |
950 | 961 |
951 TEST_P(QuicStreamFactoryTest, OnCertAdded) { | 962 TEST_P(QuicStreamFactoryTest, OnCertAdded) { |
952 MockRead reads[] = { | 963 MockRead reads[] = { |
953 MockRead(ASYNC, 0, 0) // EOF | 964 MockRead(ASYNC, 0, 0) // EOF |
954 }; | 965 }; |
955 scoped_ptr<QuicEncryptedPacket> rst(ConstructRstPacket()); | 966 scoped_ptr<QuicEncryptedPacket> rst(ConstructRstPacket()); |
956 std::vector<MockWrite> writes; | 967 std::vector<MockWrite> writes; |
957 writes.push_back(MockWrite(ASYNC, rst->data(), rst->length(), 1)); | 968 writes.push_back(MockWrite(ASYNC, rst->data(), rst->length(), 1)); |
958 DeterministicSocketData socket_data(reads, arraysize(reads), | 969 DeterministicSocketData socket_data(reads, |
959 writes.empty() ? NULL : &writes[0], | 970 arraysize(reads), |
| 971 writes.empty() ? NULL : &writes[0], |
960 writes.size()); | 972 writes.size()); |
961 socket_factory_.AddSocketDataProvider(&socket_data); | 973 socket_factory_.AddSocketDataProvider(&socket_data); |
962 socket_data.StopAfter(1); | 974 socket_data.StopAfter(1); |
963 | 975 |
964 MockRead reads2[] = { | 976 MockRead reads2[] = { |
965 MockRead(ASYNC, 0, 0) // EOF | 977 MockRead(ASYNC, 0, 0) // EOF |
966 }; | 978 }; |
967 DeterministicSocketData socket_data2(reads2, arraysize(reads2), NULL, 0); | 979 DeterministicSocketData socket_data2(reads2, arraysize(reads2), NULL, 0); |
968 socket_factory_.AddSocketDataProvider(&socket_data2); | 980 socket_factory_.AddSocketDataProvider(&socket_data2); |
969 socket_data2.StopAfter(1); | 981 socket_data2.StopAfter(1); |
970 | 982 |
971 QuicStreamRequest request(&factory_); | 983 QuicStreamRequest request(&factory_); |
972 EXPECT_EQ(ERR_IO_PENDING, | 984 EXPECT_EQ(ERR_IO_PENDING, |
973 request.Request(host_port_pair_, | 985 request.Request(host_port_pair_, |
974 is_https_, | 986 is_https_, |
975 privacy_mode_, | 987 privacy_mode_, |
976 "GET", | 988 "GET", |
977 net_log_, | 989 net_log_, |
978 callback_.callback())); | 990 callback_.callback())); |
979 | 991 |
980 EXPECT_EQ(OK, callback_.WaitForResult()); | 992 EXPECT_EQ(OK, callback_.WaitForResult()); |
981 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 993 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
982 HttpRequestInfo request_info; | 994 HttpRequestInfo request_info; |
983 EXPECT_EQ(OK, stream->InitializeStream(&request_info, | 995 EXPECT_EQ( |
984 DEFAULT_PRIORITY, | 996 OK, |
985 net_log_, CompletionCallback())); | 997 stream->InitializeStream( |
| 998 &request_info, DEFAULT_PRIORITY, net_log_, CompletionCallback())); |
986 | 999 |
987 // Add a cert and verify that stream saw the event. | 1000 // Add a cert and verify that stream saw the event. |
988 factory_.OnCertAdded(NULL); | 1001 factory_.OnCertAdded(NULL); |
989 EXPECT_EQ(ERR_CERT_DATABASE_CHANGED, | 1002 EXPECT_EQ(ERR_CERT_DATABASE_CHANGED, |
990 stream->ReadResponseHeaders(callback_.callback())); | 1003 stream->ReadResponseHeaders(callback_.callback())); |
991 EXPECT_FALSE(factory_.require_confirmation()); | 1004 EXPECT_FALSE(factory_.require_confirmation()); |
992 | 1005 |
993 // Now attempting to request a stream to the same origin should create | 1006 // Now attempting to request a stream to the same origin should create |
994 // a new session. | 1007 // a new session. |
995 | 1008 |
(...skipping 11 matching lines...) Expand all Loading... |
1007 stream.reset(); // Will reset stream 3. | 1020 stream.reset(); // Will reset stream 3. |
1008 | 1021 |
1009 EXPECT_TRUE(socket_data.at_read_eof()); | 1022 EXPECT_TRUE(socket_data.at_read_eof()); |
1010 EXPECT_TRUE(socket_data.at_write_eof()); | 1023 EXPECT_TRUE(socket_data.at_write_eof()); |
1011 EXPECT_TRUE(socket_data2.at_read_eof()); | 1024 EXPECT_TRUE(socket_data2.at_read_eof()); |
1012 EXPECT_TRUE(socket_data2.at_write_eof()); | 1025 EXPECT_TRUE(socket_data2.at_write_eof()); |
1013 } | 1026 } |
1014 | 1027 |
1015 TEST_P(QuicStreamFactoryTest, OnCACertChanged) { | 1028 TEST_P(QuicStreamFactoryTest, OnCACertChanged) { |
1016 MockRead reads[] = { | 1029 MockRead reads[] = { |
1017 MockRead(ASYNC, 0, 0) // EOF | 1030 MockRead(ASYNC, 0, 0) // EOF |
1018 }; | 1031 }; |
1019 scoped_ptr<QuicEncryptedPacket> rst(ConstructRstPacket()); | 1032 scoped_ptr<QuicEncryptedPacket> rst(ConstructRstPacket()); |
1020 std::vector<MockWrite> writes; | 1033 std::vector<MockWrite> writes; |
1021 writes.push_back(MockWrite(ASYNC, rst->data(), rst->length(), 1)); | 1034 writes.push_back(MockWrite(ASYNC, rst->data(), rst->length(), 1)); |
1022 DeterministicSocketData socket_data(reads, arraysize(reads), | 1035 DeterministicSocketData socket_data(reads, |
1023 writes.empty() ? NULL : &writes[0], | 1036 arraysize(reads), |
| 1037 writes.empty() ? NULL : &writes[0], |
1024 writes.size()); | 1038 writes.size()); |
1025 socket_factory_.AddSocketDataProvider(&socket_data); | 1039 socket_factory_.AddSocketDataProvider(&socket_data); |
1026 socket_data.StopAfter(1); | 1040 socket_data.StopAfter(1); |
1027 | 1041 |
1028 MockRead reads2[] = { | 1042 MockRead reads2[] = { |
1029 MockRead(ASYNC, 0, 0) // EOF | 1043 MockRead(ASYNC, 0, 0) // EOF |
1030 }; | 1044 }; |
1031 DeterministicSocketData socket_data2(reads2, arraysize(reads2), NULL, 0); | 1045 DeterministicSocketData socket_data2(reads2, arraysize(reads2), NULL, 0); |
1032 socket_factory_.AddSocketDataProvider(&socket_data2); | 1046 socket_factory_.AddSocketDataProvider(&socket_data2); |
1033 socket_data2.StopAfter(1); | 1047 socket_data2.StopAfter(1); |
1034 | 1048 |
1035 QuicStreamRequest request(&factory_); | 1049 QuicStreamRequest request(&factory_); |
1036 EXPECT_EQ(ERR_IO_PENDING, | 1050 EXPECT_EQ(ERR_IO_PENDING, |
1037 request.Request(host_port_pair_, | 1051 request.Request(host_port_pair_, |
1038 is_https_, | 1052 is_https_, |
1039 privacy_mode_, | 1053 privacy_mode_, |
1040 "GET", | 1054 "GET", |
1041 net_log_, | 1055 net_log_, |
1042 callback_.callback())); | 1056 callback_.callback())); |
1043 | 1057 |
1044 EXPECT_EQ(OK, callback_.WaitForResult()); | 1058 EXPECT_EQ(OK, callback_.WaitForResult()); |
1045 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); | 1059 scoped_ptr<QuicHttpStream> stream = request.ReleaseStream(); |
1046 HttpRequestInfo request_info; | 1060 HttpRequestInfo request_info; |
1047 EXPECT_EQ(OK, stream->InitializeStream(&request_info, | 1061 EXPECT_EQ( |
1048 DEFAULT_PRIORITY, | 1062 OK, |
1049 net_log_, CompletionCallback())); | 1063 stream->InitializeStream( |
| 1064 &request_info, DEFAULT_PRIORITY, net_log_, CompletionCallback())); |
1050 | 1065 |
1051 // Change the CA cert and verify that stream saw the event. | 1066 // Change the CA cert and verify that stream saw the event. |
1052 factory_.OnCACertChanged(NULL); | 1067 factory_.OnCACertChanged(NULL); |
1053 EXPECT_EQ(ERR_CERT_DATABASE_CHANGED, | 1068 EXPECT_EQ(ERR_CERT_DATABASE_CHANGED, |
1054 stream->ReadResponseHeaders(callback_.callback())); | 1069 stream->ReadResponseHeaders(callback_.callback())); |
1055 EXPECT_FALSE(factory_.require_confirmation()); | 1070 EXPECT_FALSE(factory_.require_confirmation()); |
1056 | 1071 |
1057 // Now attempting to request a stream to the same origin should create | 1072 // Now attempting to request a stream to the same origin should create |
1058 // a new session. | 1073 // a new session. |
1059 | 1074 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 QuicCryptoClientConfig::CachedState* cached2 = | 1155 QuicCryptoClientConfig::CachedState* cached2 = |
1141 crypto_config->LookupOrCreate(server_id2); | 1156 crypto_config->LookupOrCreate(server_id2); |
1142 EXPECT_NE(cached1->source_address_token(), cached2->source_address_token()); | 1157 EXPECT_NE(cached1->source_address_token(), cached2->source_address_token()); |
1143 EXPECT_TRUE(cached2->source_address_token().empty()); | 1158 EXPECT_TRUE(cached2->source_address_token().empty()); |
1144 EXPECT_FALSE(cached2->proof_valid()); | 1159 EXPECT_FALSE(cached2->proof_valid()); |
1145 } | 1160 } |
1146 } | 1161 } |
1147 | 1162 |
1148 } // namespace test | 1163 } // namespace test |
1149 } // namespace net | 1164 } // namespace net |
OLD | NEW |