OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/http/http_proxy_client_socket_pool.h" | 5 #include "net/http/http_proxy_client_socket_pool.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 } | 139 } |
140 | 140 |
141 scoped_refptr<HttpProxySocketParams> GetNoTunnelParams() { | 141 scoped_refptr<HttpProxySocketParams> GetNoTunnelParams() { |
142 return GetParams(false); | 142 return GetParams(false); |
143 } | 143 } |
144 | 144 |
145 DeterministicMockClientSocketFactory& socket_factory() { | 145 DeterministicMockClientSocketFactory& socket_factory() { |
146 return socket_factory_; | 146 return socket_factory_; |
147 } | 147 } |
148 | 148 |
149 void Initialize(bool async, MockRead* reads, size_t reads_count, | 149 void Initialize(MockRead* reads, size_t reads_count, |
150 MockWrite* writes, size_t writes_count, | 150 MockWrite* writes, size_t writes_count, |
151 MockRead* spdy_reads, size_t spdy_reads_count, | 151 MockRead* spdy_reads, size_t spdy_reads_count, |
152 MockWrite* spdy_writes, size_t spdy_writes_count) { | 152 MockWrite* spdy_writes, size_t spdy_writes_count) { |
153 if (GetParam() == SPDY) | 153 if (GetParam() == SPDY) |
154 data_ = new DeterministicSocketData(spdy_reads, spdy_reads_count, | 154 data_ = new DeterministicSocketData(spdy_reads, spdy_reads_count, |
155 spdy_writes, spdy_writes_count); | 155 spdy_writes, spdy_writes_count); |
156 else | 156 else |
157 data_ = new DeterministicSocketData(reads, reads_count, writes, | 157 data_ = new DeterministicSocketData(reads, reads_count, writes, |
158 writes_count); | 158 writes_count); |
159 | 159 |
160 data_->set_connect_data(MockConnect(async, 0)); | 160 data_->set_connect_data(MockConnect(SYNCHRONOUS, OK)); |
161 data_->StopAfter(2); // Request / Response | 161 data_->StopAfter(2); // Request / Response |
162 | 162 |
163 socket_factory_.AddSocketDataProvider(data_.get()); | 163 socket_factory_.AddSocketDataProvider(data_.get()); |
164 | 164 |
165 if (GetParam() != HTTP) { | 165 if (GetParam() != HTTP) { |
166 ssl_data_.reset(new SSLSocketDataProvider(async, OK)); | 166 ssl_data_.reset(new SSLSocketDataProvider(false, OK)); |
jar (doing other things)
2012/02/17 17:19:16
There is a chance that this strategy should be pus
Ryan Hamilton
2012/02/17 17:33:56
Yes, totally agree. I want to push this change in
| |
167 if (GetParam() == SPDY) { | 167 if (GetParam() == SPDY) { |
168 InitializeSpdySsl(); | 168 InitializeSpdySsl(); |
169 } | 169 } |
170 socket_factory_.AddSSLSocketDataProvider(ssl_data_.get()); | 170 socket_factory_.AddSSLSocketDataProvider(ssl_data_.get()); |
171 } | 171 } |
172 } | 172 } |
173 | 173 |
174 void InitializeSpdySsl() { | 174 void InitializeSpdySsl() { |
175 spdy::SpdyFramer::set_enable_compression_default(false); | 175 spdy::SpdyFramer::set_enable_compression_default(false); |
176 ssl_data_->next_proto_status = SSLClientSocket::kNextProtoNegotiated; | 176 ssl_data_->next_proto_status = SSLClientSocket::kNextProtoNegotiated; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 }; | 220 }; |
221 | 221 |
222 //----------------------------------------------------------------------------- | 222 //----------------------------------------------------------------------------- |
223 // All tests are run with three different proxy types: HTTP, HTTPS (non-SPDY) | 223 // All tests are run with three different proxy types: HTTP, HTTPS (non-SPDY) |
224 // and SPDY. | 224 // and SPDY. |
225 INSTANTIATE_TEST_CASE_P(HttpProxyClientSocketPoolTests, | 225 INSTANTIATE_TEST_CASE_P(HttpProxyClientSocketPoolTests, |
226 HttpProxyClientSocketPoolTest, | 226 HttpProxyClientSocketPoolTest, |
227 ::testing::Values(HTTP, HTTPS, SPDY)); | 227 ::testing::Values(HTTP, HTTPS, SPDY)); |
228 | 228 |
229 TEST_P(HttpProxyClientSocketPoolTest, NoTunnel) { | 229 TEST_P(HttpProxyClientSocketPoolTest, NoTunnel) { |
230 Initialize(false, NULL, 0, NULL, 0, NULL, 0, NULL, 0); | 230 Initialize(NULL, 0, NULL, 0, NULL, 0, NULL, 0); |
231 | 231 |
232 int rv = handle_.Init("a", GetNoTunnelParams(), LOW, CompletionCallback(), | 232 int rv = handle_.Init("a", GetNoTunnelParams(), LOW, CompletionCallback(), |
233 &pool_, BoundNetLog()); | 233 &pool_, BoundNetLog()); |
234 EXPECT_EQ(OK, rv); | 234 EXPECT_EQ(OK, rv); |
235 EXPECT_TRUE(handle_.is_initialized()); | 235 EXPECT_TRUE(handle_.is_initialized()); |
236 ASSERT_TRUE(handle_.socket()); | 236 ASSERT_TRUE(handle_.socket()); |
237 HttpProxyClientSocket* tunnel_socket = | 237 HttpProxyClientSocket* tunnel_socket = |
238 static_cast<HttpProxyClientSocket*>(handle_.socket()); | 238 static_cast<HttpProxyClientSocket*>(handle_.socket()); |
239 EXPECT_TRUE(tunnel_socket->IsConnected()); | 239 EXPECT_TRUE(tunnel_socket->IsConnected()); |
240 } | 240 } |
(...skipping 18 matching lines...) Expand all Loading... | |
259 CreateMockWrite(*rst, 2, true), | 259 CreateMockWrite(*rst, 2, true), |
260 }; | 260 }; |
261 scoped_ptr<spdy::SpdyFrame> resp( | 261 scoped_ptr<spdy::SpdyFrame> resp( |
262 ConstructSpdySynReplyError( | 262 ConstructSpdySynReplyError( |
263 "407 Proxy Authentication Required", NULL, 0, 1)); | 263 "407 Proxy Authentication Required", NULL, 0, 1)); |
264 MockRead spdy_reads[] = { | 264 MockRead spdy_reads[] = { |
265 CreateMockWrite(*resp, 1, true), | 265 CreateMockWrite(*resp, 1, true), |
266 MockRead(true, 0, 3) | 266 MockRead(true, 0, 3) |
267 }; | 267 }; |
268 | 268 |
269 Initialize(false, reads, arraysize(reads), writes, arraysize(writes), | 269 Initialize(reads, arraysize(reads), writes, arraysize(writes), |
270 spdy_reads, arraysize(spdy_reads), spdy_writes, | 270 spdy_reads, arraysize(spdy_reads), spdy_writes, |
271 arraysize(spdy_writes)); | 271 arraysize(spdy_writes)); |
272 | 272 |
273 data_->StopAfter(4); | 273 data_->StopAfter(4); |
274 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), | 274 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), |
275 &pool_, BoundNetLog()); | 275 &pool_, BoundNetLog()); |
276 EXPECT_EQ(ERR_IO_PENDING, rv); | 276 EXPECT_EQ(ERR_IO_PENDING, rv); |
277 EXPECT_FALSE(handle_.is_initialized()); | 277 EXPECT_FALSE(handle_.is_initialized()); |
278 EXPECT_FALSE(handle_.socket()); | 278 EXPECT_FALSE(handle_.socket()); |
279 | 279 |
(...skipping 24 matching lines...) Expand all Loading... | |
304 MockWrite(false, 0, | 304 MockWrite(false, 0, |
305 "CONNECT www.google.com:443 HTTP/1.1\r\n" | 305 "CONNECT www.google.com:443 HTTP/1.1\r\n" |
306 "Host: www.google.com\r\n" | 306 "Host: www.google.com\r\n" |
307 "Proxy-Connection: keep-alive\r\n" | 307 "Proxy-Connection: keep-alive\r\n" |
308 "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), | 308 "Proxy-Authorization: Basic Zm9vOmJhcg==\r\n\r\n"), |
309 }; | 309 }; |
310 MockRead reads[] = { | 310 MockRead reads[] = { |
311 MockRead(false, 1, "HTTP/1.1 200 Connection Established\r\n\r\n"), | 311 MockRead(false, 1, "HTTP/1.1 200 Connection Established\r\n\r\n"), |
312 }; | 312 }; |
313 | 313 |
314 Initialize(false, reads, arraysize(reads), writes, arraysize(writes), NULL, 0, | 314 Initialize(reads, arraysize(reads), writes, arraysize(writes), NULL, 0, |
315 NULL, 0); | 315 NULL, 0); |
316 AddAuthToCache(); | 316 AddAuthToCache(); |
317 | 317 |
318 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), | 318 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), |
319 &pool_, BoundNetLog()); | 319 &pool_, BoundNetLog()); |
320 EXPECT_EQ(OK, rv); | 320 EXPECT_EQ(OK, rv); |
321 EXPECT_TRUE(handle_.is_initialized()); | 321 EXPECT_TRUE(handle_.is_initialized()); |
322 ASSERT_TRUE(handle_.socket()); | 322 ASSERT_TRUE(handle_.socket()); |
323 HttpProxyClientSocket* tunnel_socket = | 323 HttpProxyClientSocket* tunnel_socket = |
324 static_cast<HttpProxyClientSocket*>(handle_.socket()); | 324 static_cast<HttpProxyClientSocket*>(handle_.socket()); |
(...skipping 15 matching lines...) Expand all Loading... | |
340 kAuthHeadersSize, 1)); | 340 kAuthHeadersSize, 1)); |
341 MockWrite spdy_writes[] = { | 341 MockWrite spdy_writes[] = { |
342 CreateMockWrite(*req, 0, true) | 342 CreateMockWrite(*req, 0, true) |
343 }; | 343 }; |
344 scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); | 344 scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdyGetSynReply(NULL, 0, 1)); |
345 MockRead spdy_reads[] = { | 345 MockRead spdy_reads[] = { |
346 CreateMockRead(*resp, 1, true), | 346 CreateMockRead(*resp, 1, true), |
347 MockRead(true, 0, 2) | 347 MockRead(true, 0, 2) |
348 }; | 348 }; |
349 | 349 |
350 Initialize(false, reads, arraysize(reads), writes, arraysize(writes), | 350 Initialize(reads, arraysize(reads), writes, arraysize(writes), |
351 spdy_reads, arraysize(spdy_reads), spdy_writes, | 351 spdy_reads, arraysize(spdy_reads), spdy_writes, |
352 arraysize(spdy_writes)); | 352 arraysize(spdy_writes)); |
353 AddAuthToCache(); | 353 AddAuthToCache(); |
354 | 354 |
355 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), | 355 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), |
356 &pool_, BoundNetLog()); | 356 &pool_, BoundNetLog()); |
357 EXPECT_EQ(ERR_IO_PENDING, rv); | 357 EXPECT_EQ(ERR_IO_PENDING, rv); |
358 EXPECT_FALSE(handle_.is_initialized()); | 358 EXPECT_FALSE(handle_.is_initialized()); |
359 EXPECT_FALSE(handle_.socket()); | 359 EXPECT_FALSE(handle_.socket()); |
360 | 360 |
361 data_->RunFor(2); | 361 data_->RunFor(2); |
362 EXPECT_EQ(OK, callback_.WaitForResult()); | 362 EXPECT_EQ(OK, callback_.WaitForResult()); |
363 EXPECT_TRUE(handle_.is_initialized()); | 363 EXPECT_TRUE(handle_.is_initialized()); |
364 ASSERT_TRUE(handle_.socket()); | 364 ASSERT_TRUE(handle_.socket()); |
365 HttpProxyClientSocket* tunnel_socket = | 365 HttpProxyClientSocket* tunnel_socket = |
366 static_cast<HttpProxyClientSocket*>(handle_.socket()); | 366 static_cast<HttpProxyClientSocket*>(handle_.socket()); |
367 EXPECT_TRUE(tunnel_socket->IsConnected()); | 367 EXPECT_TRUE(tunnel_socket->IsConnected()); |
368 } | 368 } |
369 | 369 |
370 TEST_P(HttpProxyClientSocketPoolTest, TCPError) { | 370 TEST_P(HttpProxyClientSocketPoolTest, TCPError) { |
371 if (GetParam() == SPDY) return; | 371 if (GetParam() == SPDY) return; |
372 data_ = new DeterministicSocketData(NULL, 0, NULL, 0); | 372 data_ = new DeterministicSocketData(NULL, 0, NULL, 0); |
373 data_->set_connect_data(MockConnect(true, ERR_CONNECTION_CLOSED)); | 373 data_->set_connect_data(MockConnect(ASYNC, ERR_CONNECTION_CLOSED)); |
374 | 374 |
375 socket_factory().AddSocketDataProvider(data_.get()); | 375 socket_factory().AddSocketDataProvider(data_.get()); |
376 | 376 |
377 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), | 377 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), |
378 &pool_, BoundNetLog()); | 378 &pool_, BoundNetLog()); |
379 EXPECT_EQ(ERR_IO_PENDING, rv); | 379 EXPECT_EQ(ERR_IO_PENDING, rv); |
380 EXPECT_FALSE(handle_.is_initialized()); | 380 EXPECT_FALSE(handle_.is_initialized()); |
381 EXPECT_FALSE(handle_.socket()); | 381 EXPECT_FALSE(handle_.socket()); |
382 | 382 |
383 EXPECT_EQ(ERR_PROXY_CONNECTION_FAILED, callback_.WaitForResult()); | 383 EXPECT_EQ(ERR_PROXY_CONNECTION_FAILED, callback_.WaitForResult()); |
384 | 384 |
385 EXPECT_FALSE(handle_.is_initialized()); | 385 EXPECT_FALSE(handle_.is_initialized()); |
386 EXPECT_FALSE(handle_.socket()); | 386 EXPECT_FALSE(handle_.socket()); |
387 } | 387 } |
388 | 388 |
389 TEST_P(HttpProxyClientSocketPoolTest, SSLError) { | 389 TEST_P(HttpProxyClientSocketPoolTest, SSLError) { |
390 if (GetParam() == HTTP) return; | 390 if (GetParam() == HTTP) return; |
391 data_ = new DeterministicSocketData(NULL, 0, NULL, 0); | 391 data_ = new DeterministicSocketData(NULL, 0, NULL, 0); |
392 data_->set_connect_data(MockConnect(true, OK)); | 392 data_->set_connect_data(MockConnect(ASYNC, OK)); |
393 socket_factory().AddSocketDataProvider(data_.get()); | 393 socket_factory().AddSocketDataProvider(data_.get()); |
394 | 394 |
395 ssl_data_.reset(new SSLSocketDataProvider(true, | 395 ssl_data_.reset(new SSLSocketDataProvider(true, |
396 ERR_CERT_AUTHORITY_INVALID)); | 396 ERR_CERT_AUTHORITY_INVALID)); |
397 if (GetParam() == SPDY) { | 397 if (GetParam() == SPDY) { |
398 InitializeSpdySsl(); | 398 InitializeSpdySsl(); |
399 } | 399 } |
400 socket_factory().AddSSLSocketDataProvider(ssl_data_.get()); | 400 socket_factory().AddSSLSocketDataProvider(ssl_data_.get()); |
401 | 401 |
402 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), | 402 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), |
403 &pool_, BoundNetLog()); | 403 &pool_, BoundNetLog()); |
404 EXPECT_EQ(ERR_IO_PENDING, rv); | 404 EXPECT_EQ(ERR_IO_PENDING, rv); |
405 EXPECT_FALSE(handle_.is_initialized()); | 405 EXPECT_FALSE(handle_.is_initialized()); |
406 EXPECT_FALSE(handle_.socket()); | 406 EXPECT_FALSE(handle_.socket()); |
407 | 407 |
408 EXPECT_EQ(ERR_PROXY_CERTIFICATE_INVALID, callback_.WaitForResult()); | 408 EXPECT_EQ(ERR_PROXY_CERTIFICATE_INVALID, callback_.WaitForResult()); |
409 | 409 |
410 EXPECT_FALSE(handle_.is_initialized()); | 410 EXPECT_FALSE(handle_.is_initialized()); |
411 EXPECT_FALSE(handle_.socket()); | 411 EXPECT_FALSE(handle_.socket()); |
412 } | 412 } |
413 | 413 |
414 TEST_P(HttpProxyClientSocketPoolTest, SslClientAuth) { | 414 TEST_P(HttpProxyClientSocketPoolTest, SslClientAuth) { |
415 if (GetParam() == HTTP) return; | 415 if (GetParam() == HTTP) return; |
416 data_ = new DeterministicSocketData(NULL, 0, NULL, 0); | 416 data_ = new DeterministicSocketData(NULL, 0, NULL, 0); |
417 data_->set_connect_data(MockConnect(true, OK)); | 417 data_->set_connect_data(MockConnect(ASYNC, OK)); |
418 socket_factory().AddSocketDataProvider(data_.get()); | 418 socket_factory().AddSocketDataProvider(data_.get()); |
419 | 419 |
420 ssl_data_.reset(new SSLSocketDataProvider(true, | 420 ssl_data_.reset(new SSLSocketDataProvider(true, |
421 ERR_SSL_CLIENT_AUTH_CERT_NEEDED)); | 421 ERR_SSL_CLIENT_AUTH_CERT_NEEDED)); |
422 if (GetParam() == SPDY) { | 422 if (GetParam() == SPDY) { |
423 InitializeSpdySsl(); | 423 InitializeSpdySsl(); |
424 } | 424 } |
425 socket_factory().AddSSLSocketDataProvider(ssl_data_.get()); | 425 socket_factory().AddSSLSocketDataProvider(ssl_data_.get()); |
426 | 426 |
427 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), | 427 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), |
(...skipping 22 matching lines...) Expand all Loading... | |
450 }; | 450 }; |
451 scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, | 451 scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyConnect(kAuthHeaders, |
452 kAuthHeadersSize, 1)); | 452 kAuthHeadersSize, 1)); |
453 MockWrite spdy_writes[] = { | 453 MockWrite spdy_writes[] = { |
454 CreateMockWrite(*req, 0, true) | 454 CreateMockWrite(*req, 0, true) |
455 }; | 455 }; |
456 MockRead spdy_reads[] = { | 456 MockRead spdy_reads[] = { |
457 MockRead(true, ERR_CONNECTION_CLOSED, 1), | 457 MockRead(true, ERR_CONNECTION_CLOSED, 1), |
458 }; | 458 }; |
459 | 459 |
460 Initialize(false, reads, arraysize(reads), writes, arraysize(writes), | 460 Initialize(reads, arraysize(reads), writes, arraysize(writes), |
461 spdy_reads, arraysize(spdy_reads), spdy_writes, | 461 spdy_reads, arraysize(spdy_reads), spdy_writes, |
462 arraysize(spdy_writes)); | 462 arraysize(spdy_writes)); |
463 AddAuthToCache(); | 463 AddAuthToCache(); |
464 | 464 |
465 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), | 465 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), |
466 &pool_, BoundNetLog()); | 466 &pool_, BoundNetLog()); |
467 EXPECT_EQ(ERR_IO_PENDING, rv); | 467 EXPECT_EQ(ERR_IO_PENDING, rv); |
468 EXPECT_FALSE(handle_.is_initialized()); | 468 EXPECT_FALSE(handle_.is_initialized()); |
469 EXPECT_FALSE(handle_.socket()); | 469 EXPECT_FALSE(handle_.socket()); |
470 | 470 |
(...skipping 20 matching lines...) Expand all Loading... | |
491 MockWrite spdy_writes[] = { | 491 MockWrite spdy_writes[] = { |
492 CreateMockWrite(*req, 0, true), | 492 CreateMockWrite(*req, 0, true), |
493 CreateMockWrite(*rst, 2, true), | 493 CreateMockWrite(*rst, 2, true), |
494 }; | 494 }; |
495 scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdySynReplyError(1)); | 495 scoped_ptr<spdy::SpdyFrame> resp(ConstructSpdySynReplyError(1)); |
496 MockRead spdy_reads[] = { | 496 MockRead spdy_reads[] = { |
497 CreateMockRead(*resp, 1, true), | 497 CreateMockRead(*resp, 1, true), |
498 MockRead(true, 0, 3), | 498 MockRead(true, 0, 3), |
499 }; | 499 }; |
500 | 500 |
501 Initialize(false, reads, arraysize(reads), writes, arraysize(writes), | 501 Initialize(reads, arraysize(reads), writes, arraysize(writes), |
502 spdy_reads, arraysize(spdy_reads), spdy_writes, | 502 spdy_reads, arraysize(spdy_reads), spdy_writes, |
503 arraysize(spdy_writes)); | 503 arraysize(spdy_writes)); |
504 AddAuthToCache(); | 504 AddAuthToCache(); |
505 | 505 |
506 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), | 506 int rv = handle_.Init("a", GetTunnelParams(), LOW, callback_.callback(), |
507 &pool_, BoundNetLog()); | 507 &pool_, BoundNetLog()); |
508 EXPECT_EQ(ERR_IO_PENDING, rv); | 508 EXPECT_EQ(ERR_IO_PENDING, rv); |
509 EXPECT_FALSE(handle_.is_initialized()); | 509 EXPECT_FALSE(handle_.is_initialized()); |
510 EXPECT_FALSE(handle_.socket()); | 510 EXPECT_FALSE(handle_.socket()); |
511 | 511 |
512 data_->RunFor(2); | 512 data_->RunFor(2); |
513 | 513 |
514 rv = callback_.WaitForResult(); | 514 rv = callback_.WaitForResult(); |
515 if (GetParam() == HTTP) { | 515 if (GetParam() == HTTP) { |
516 // HTTP Proxy CONNECT responses are not trustworthy | 516 // HTTP Proxy CONNECT responses are not trustworthy |
517 EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv); | 517 EXPECT_EQ(ERR_TUNNEL_CONNECTION_FAILED, rv); |
518 EXPECT_FALSE(handle_.is_initialized()); | 518 EXPECT_FALSE(handle_.is_initialized()); |
519 EXPECT_FALSE(handle_.socket()); | 519 EXPECT_FALSE(handle_.socket()); |
520 } else { | 520 } else { |
521 // HTTPS or SPDY Proxy CONNECT responses are trustworthy | 521 // HTTPS or SPDY Proxy CONNECT responses are trustworthy |
522 EXPECT_EQ(ERR_HTTPS_PROXY_TUNNEL_RESPONSE, rv); | 522 EXPECT_EQ(ERR_HTTPS_PROXY_TUNNEL_RESPONSE, rv); |
523 EXPECT_TRUE(handle_.is_initialized()); | 523 EXPECT_TRUE(handle_.is_initialized()); |
524 EXPECT_TRUE(handle_.socket()); | 524 EXPECT_TRUE(handle_.socket()); |
525 } | 525 } |
526 } | 526 } |
527 | 527 |
528 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. | 528 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. |
529 | 529 |
530 } // namespace net | 530 } // namespace net |
OLD | NEW |