| 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/time.h" | 10 #include "base/time.h" |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 } | 650 } |
| 651 | 651 |
| 652 TEST_F(SSLClientSocketPoolTest, IPPooling) { | 652 TEST_F(SSLClientSocketPoolTest, IPPooling) { |
| 653 const int kTestPort = 80; | 653 const int kTestPort = 80; |
| 654 struct TestHosts { | 654 struct TestHosts { |
| 655 std::string name; | 655 std::string name; |
| 656 std::string iplist; | 656 std::string iplist; |
| 657 HostPortProxyPair pair; | 657 HostPortProxyPair pair; |
| 658 } test_hosts[] = { | 658 } test_hosts[] = { |
| 659 { "www.webkit.org", "192.168.0.1,192.168.0.5" }, | 659 { "www.webkit.org", "192.168.0.1,192.168.0.5" }, |
| 660 { "code.google.com", "192.168.0.2,192.168.0.3,192.168.0.5" }, | 660 { "code.google.com", "192.168.0.2,192.168.0.3,192.168.0.1" }, |
| 661 { "js.webkit.org", "192.168.0.4,192.168.0.5" }, | 661 { "js.webkit.org", "192.168.0.4,192.168.0.5" }, |
| 662 }; | 662 }; |
| 663 | 663 |
| 664 host_resolver_.set_synchronous_mode(true); | 664 host_resolver_.set_synchronous_mode(true); |
| 665 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) { | 665 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(test_hosts); i++) { |
| 666 host_resolver_.rules()->AddIPLiteralRule(test_hosts[i].name, | 666 host_resolver_.rules()->AddIPLiteralRule(test_hosts[i].name, |
| 667 test_hosts[i].iplist, ""); | 667 test_hosts[i].iplist, ""); |
| 668 | 668 |
| 669 // This test requires that the HostResolver cache be populated. Normal | 669 // This test requires that the HostResolver cache be populated. Normal |
| 670 // code would have done this already, but we do it manually. | 670 // code would have done this already, but we do it manually. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 EXPECT_TRUE(session_->spdy_session_pool()->HasSession(test_hosts[2].pair)); | 723 EXPECT_TRUE(session_->spdy_session_pool()->HasSession(test_hosts[2].pair)); |
| 724 | 724 |
| 725 session_->spdy_session_pool()->CloseAllSessions(); | 725 session_->spdy_session_pool()->CloseAllSessions(); |
| 726 } | 726 } |
| 727 | 727 |
| 728 // It would be nice to also test the timeouts in SSLClientSocketPool. | 728 // It would be nice to also test the timeouts in SSLClientSocketPool. |
| 729 | 729 |
| 730 } // namespace | 730 } // namespace |
| 731 | 731 |
| 732 } // namespace net | 732 } // namespace net |
| OLD | NEW |