| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <math.h> // ceil | 5 #include <math.h> // ceil |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "net/base/client_socket_factory.h" | 8 #include "net/base/client_socket_factory.h" |
| 9 #include "net/base/test_completion_callback.h" | 9 #include "net/base/test_completion_callback.h" |
| 10 #include "net/base/upload_data.h" | 10 #include "net/base/upload_data.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 MockClientSocketFactory mock_socket_factory; | 200 MockClientSocketFactory mock_socket_factory; |
| 201 | 201 |
| 202 // Create a proxy service which fails on all requests (falls back to direct). | 202 // Create a proxy service which fails on all requests (falls back to direct). |
| 203 net::ProxyService* CreateNullProxyService() { | 203 net::ProxyService* CreateNullProxyService() { |
| 204 return net::ProxyService::CreateNull(); | 204 return net::ProxyService::CreateNull(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 net::ProxyService* CreateFixedProxyService(const std::string& proxy) { | 207 net::ProxyService* CreateFixedProxyService(const std::string& proxy) { |
| 208 net::ProxyInfo proxy_info; | 208 net::ProxyInfo proxy_info; |
| 209 proxy_info.UseNamedProxy(proxy); | 209 proxy_info.UseNamedProxy(proxy); |
| 210 return new net::ProxyService( | 210 return net::ProxyService::Create(&proxy_info); |
| 211 new net::ProxyConfigServiceFixed(proxy_info), NULL); | |
| 212 } | 211 } |
| 213 | 212 |
| 214 | 213 |
| 215 net::HttpNetworkSession* CreateSession(net::ProxyService* proxy_service) { | 214 net::HttpNetworkSession* CreateSession(net::ProxyService* proxy_service) { |
| 216 return new net::HttpNetworkSession(proxy_service); | 215 return new net::HttpNetworkSession(proxy_service); |
| 217 } | 216 } |
| 218 | 217 |
| 219 class HttpNetworkTransactionTest : public PlatformTest { | 218 class HttpNetworkTransactionTest : public PlatformTest { |
| 220 public: | 219 public: |
| 221 virtual void SetUp() { | 220 virtual void SetUp() { |
| (...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1519 | 1518 |
| 1520 rv = callback2.WaitForResult(); | 1519 rv = callback2.WaitForResult(); |
| 1521 EXPECT_EQ(net::OK, rv); | 1520 EXPECT_EQ(net::OK, rv); |
| 1522 | 1521 |
| 1523 response = trans->GetResponseInfo(); | 1522 response = trans->GetResponseInfo(); |
| 1524 EXPECT_FALSE(response == NULL); | 1523 EXPECT_FALSE(response == NULL); |
| 1525 EXPECT_TRUE(response->auth_challenge.get() == NULL); | 1524 EXPECT_TRUE(response->auth_challenge.get() == NULL); |
| 1526 EXPECT_EQ(100, response->headers->GetContentLength()); | 1525 EXPECT_EQ(100, response->headers->GetContentLength()); |
| 1527 } | 1526 } |
| 1528 } | 1527 } |
| OLD | NEW |