| OLD | NEW |
| 1 // Copyright (c) 2011 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_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "net/base/cert_verifier.h" | 10 #include "net/base/cert_verifier.h" |
| 11 #include "net/base/mock_host_resolver.h" | 11 #include "net/base/mock_host_resolver.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 peer.SetHttpStreamFactory(mock_factory); | 170 peer.SetHttpStreamFactory(mock_factory); |
| 171 SSLConfig ssl_config; | 171 SSLConfig ssl_config; |
| 172 session->ssl_config_service()->GetSSLConfig(&ssl_config); | 172 session->ssl_config_service()->GetSSLConfig(&ssl_config); |
| 173 | 173 |
| 174 HttpRequestInfo request; | 174 HttpRequestInfo request; |
| 175 request.method = "GET"; | 175 request.method = "GET"; |
| 176 request.url = url; | 176 request.url = url; |
| 177 request.load_flags = 0; | 177 request.load_flags = 0; |
| 178 | 178 |
| 179 session->http_stream_factory()->PreconnectStreams( | 179 session->http_stream_factory()->PreconnectStreams( |
| 180 num_streams, request, ssl_config, ssl_config, BoundNetLog()); | 180 num_streams, request, ssl_config, ssl_config); |
| 181 mock_factory->WaitForPreconnects(); | 181 mock_factory->WaitForPreconnects(); |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 void PreconnectHelper(const TestCase& test, | 184 void PreconnectHelper(const TestCase& test, |
| 185 HttpNetworkSession* session) { | 185 HttpNetworkSession* session) { |
| 186 GURL url = test.ssl ? GURL("https://www.google.com") : | 186 GURL url = test.ssl ? GURL("https://www.google.com") : |
| 187 GURL("http://www.google.com"); | 187 GURL("http://www.google.com"); |
| 188 PreconnectHelperForURL(test.num_streams, url, session); | 188 PreconnectHelperForURL(test.num_streams, url, session); |
| 189 }; | 189 }; |
| 190 | 190 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 const ProxyRetryInfoMap& retry_info = | 453 const ProxyRetryInfoMap& retry_info = |
| 454 session->proxy_service()->proxy_retry_info(); | 454 session->proxy_service()->proxy_retry_info(); |
| 455 EXPECT_EQ(1u, retry_info.size()); | 455 EXPECT_EQ(1u, retry_info.size()); |
| 456 ProxyRetryInfoMap::const_iterator iter = retry_info.find("bad:99"); | 456 ProxyRetryInfoMap::const_iterator iter = retry_info.find("bad:99"); |
| 457 EXPECT_TRUE(iter != retry_info.end()); | 457 EXPECT_TRUE(iter != retry_info.end()); |
| 458 } | 458 } |
| 459 | 459 |
| 460 } // namespace | 460 } // namespace |
| 461 | 461 |
| 462 } // namespace net | 462 } // namespace net |
| OLD | NEW |