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/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/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
519 int rv = handle_.Init("a", CreateTunnelParams(proxy_delegate.get()), LOW, | 519 int rv = handle_.Init("a", CreateTunnelParams(proxy_delegate.get()), LOW, |
520 callback_.callback(), &pool_, BoundNetLog()); | 520 callback_.callback(), &pool_, BoundNetLog()); |
521 EXPECT_EQ(ERR_IO_PENDING, rv); | 521 EXPECT_EQ(ERR_IO_PENDING, rv); |
522 EXPECT_FALSE(handle_.is_initialized()); | 522 EXPECT_FALSE(handle_.is_initialized()); |
523 EXPECT_FALSE(handle_.socket()); | 523 EXPECT_FALSE(handle_.socket()); |
524 | 524 |
525 data_->RunFor(2); | 525 data_->RunFor(2); |
526 EXPECT_EQ(OK, callback_.WaitForResult()); | 526 EXPECT_EQ(OK, callback_.WaitForResult()); |
527 EXPECT_TRUE(handle_.is_initialized()); | 527 EXPECT_TRUE(handle_.is_initialized()); |
528 ASSERT_TRUE(handle_.socket()); | 528 ASSERT_TRUE(handle_.socket()); |
529 HttpProxyClientSocket* tunnel_socket = | 529 StreamSocket* tunnel_socket = handle_.socket(); |
530 static_cast<HttpProxyClientSocket*>(handle_.socket()); | |
531 EXPECT_TRUE(tunnel_socket->IsConnected()); | 530 EXPECT_TRUE(tunnel_socket->IsConnected()); |
Ryan Hamilton
2015/02/24 05:39:30
You could also inline this to be handle_.socket()-
| |
532 proxy_delegate->VerifyOnTunnelRequestCompleted( | 531 proxy_delegate->VerifyOnTunnelRequestCompleted( |
533 "www.google.com:443", | 532 "www.google.com:443", |
534 proxy_host_port.c_str()); | 533 proxy_host_port.c_str()); |
535 } | 534 } |
536 | 535 |
537 // Make sure that HttpProxyConnectJob passes on its priority to its | 536 // Make sure that HttpProxyConnectJob passes on its priority to its |
538 // SPDY session's socket request on Init (if applicable). | 537 // SPDY session's socket request on Init (if applicable). |
539 TEST_P(HttpProxyClientSocketPoolTest, | 538 TEST_P(HttpProxyClientSocketPoolTest, |
540 SetSpdySessionSocketRequestPriorityOnInit) { | 539 SetSpdySessionSocketRequestPriorityOnInit) { |
541 if (GetParam().proxy_type != SPDY) | 540 if (GetParam().proxy_type != SPDY) |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
843 EXPECT_TRUE(headers->IsRedirect(&location)); | 842 EXPECT_TRUE(headers->IsRedirect(&location)); |
844 EXPECT_EQ(location, redirectTarget); | 843 EXPECT_EQ(location, redirectTarget); |
845 } | 844 } |
846 } | 845 } |
847 | 846 |
848 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. | 847 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. |
849 | 848 |
850 } // namespace | 849 } // namespace |
851 | 850 |
852 } // namespace net | 851 } // namespace net |
OLD | NEW |