| 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 EXPECT_TRUE(handle_.socket()->IsConnected()); |
| 530 static_cast<HttpProxyClientSocket*>(handle_.socket()); | |
| 531 EXPECT_TRUE(tunnel_socket->IsConnected()); | |
| 532 proxy_delegate->VerifyOnTunnelRequestCompleted( | 530 proxy_delegate->VerifyOnTunnelRequestCompleted( |
| 533 "www.google.com:443", | 531 "www.google.com:443", |
| 534 proxy_host_port.c_str()); | 532 proxy_host_port.c_str()); |
| 535 } | 533 } |
| 536 | 534 |
| 537 // Make sure that HttpProxyConnectJob passes on its priority to its | 535 // Make sure that HttpProxyConnectJob passes on its priority to its |
| 538 // SPDY session's socket request on Init (if applicable). | 536 // SPDY session's socket request on Init (if applicable). |
| 539 TEST_P(HttpProxyClientSocketPoolTest, | 537 TEST_P(HttpProxyClientSocketPoolTest, |
| 540 SetSpdySessionSocketRequestPriorityOnInit) { | 538 SetSpdySessionSocketRequestPriorityOnInit) { |
| 541 if (GetParam().proxy_type != SPDY) | 539 if (GetParam().proxy_type != SPDY) |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 EXPECT_TRUE(headers->IsRedirect(&location)); | 841 EXPECT_TRUE(headers->IsRedirect(&location)); |
| 844 EXPECT_EQ(location, redirectTarget); | 842 EXPECT_EQ(location, redirectTarget); |
| 845 } | 843 } |
| 846 } | 844 } |
| 847 | 845 |
| 848 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. | 846 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. |
| 849 | 847 |
| 850 } // namespace | 848 } // namespace |
| 851 | 849 |
| 852 } // namespace net | 850 } // namespace net |
| OLD | NEW |