| 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/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
| 10 #include "net/base/ssl_client_socket.h" | 10 #include "net/base/ssl_client_socket.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 MockClientSocketFactory mock_socket_factory; | 340 MockClientSocketFactory mock_socket_factory; |
| 341 | 341 |
| 342 // Create a proxy service which fails on all requests (falls back to direct). | 342 // Create a proxy service which fails on all requests (falls back to direct). |
| 343 ProxyService* CreateNullProxyService() { | 343 ProxyService* CreateNullProxyService() { |
| 344 return ProxyService::CreateNull(); | 344 return ProxyService::CreateNull(); |
| 345 } | 345 } |
| 346 | 346 |
| 347 ProxyService* CreateFixedProxyService(const std::string& proxy) { | 347 ProxyService* CreateFixedProxyService(const std::string& proxy) { |
| 348 net::ProxyConfig proxy_config; | 348 net::ProxyConfig proxy_config; |
| 349 proxy_config.proxy_rules.ParseFromString(proxy); | 349 proxy_config.proxy_rules.ParseFromString(proxy); |
| 350 return ProxyService::Create(&proxy_config); | 350 return ProxyService::CreateFixed(proxy_config); |
| 351 } | 351 } |
| 352 | 352 |
| 353 | 353 |
| 354 HttpNetworkSession* CreateSession(ProxyService* proxy_service) { | 354 HttpNetworkSession* CreateSession(ProxyService* proxy_service) { |
| 355 return new HttpNetworkSession(proxy_service); | 355 return new HttpNetworkSession(proxy_service); |
| 356 } | 356 } |
| 357 | 357 |
| 358 class HttpNetworkTransactionTest : public PlatformTest { | 358 class HttpNetworkTransactionTest : public PlatformTest { |
| 359 public: | 359 public: |
| 360 virtual void SetUp() { | 360 virtual void SetUp() { |
| (...skipping 3051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3412 TestCompletionCallback callback; | 3412 TestCompletionCallback callback; |
| 3413 | 3413 |
| 3414 int rv = trans->Start(&request, &callback); | 3414 int rv = trans->Start(&request, &callback); |
| 3415 EXPECT_EQ(ERR_IO_PENDING, rv); | 3415 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 3416 | 3416 |
| 3417 rv = callback.WaitForResult(); | 3417 rv = callback.WaitForResult(); |
| 3418 EXPECT_EQ(OK, rv); | 3418 EXPECT_EQ(OK, rv); |
| 3419 } | 3419 } |
| 3420 | 3420 |
| 3421 } // namespace net | 3421 } // namespace net |
| OLD | NEW |