| 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 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
| 7 | 7 |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 | 9 |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 public: | 43 public: |
| 44 TestURLRequestContext() { | 44 TestURLRequestContext() { |
| 45 proxy_service_ = net::ProxyService::CreateNull(); | 45 proxy_service_ = net::ProxyService::CreateNull(); |
| 46 http_transaction_factory_ = | 46 http_transaction_factory_ = |
| 47 net::HttpNetworkLayer::CreateFactory(proxy_service_); | 47 net::HttpNetworkLayer::CreateFactory(proxy_service_); |
| 48 } | 48 } |
| 49 | 49 |
| 50 explicit TestURLRequestContext(const std::string& proxy) { | 50 explicit TestURLRequestContext(const std::string& proxy) { |
| 51 net::ProxyConfig proxy_config; | 51 net::ProxyConfig proxy_config; |
| 52 proxy_config.proxy_rules.ParseFromString(proxy); | 52 proxy_config.proxy_rules.ParseFromString(proxy); |
| 53 proxy_service_ = net::ProxyService::Create(&proxy_config); | 53 proxy_service_ = net::ProxyService::CreateFixed(proxy_config); |
| 54 http_transaction_factory_ = | 54 http_transaction_factory_ = |
| 55 net::HttpNetworkLayer::CreateFactory(proxy_service_); | 55 net::HttpNetworkLayer::CreateFactory(proxy_service_); |
| 56 } | 56 } |
| 57 | 57 |
| 58 virtual ~TestURLRequestContext() { | 58 virtual ~TestURLRequestContext() { |
| 59 delete http_transaction_factory_; | 59 delete http_transaction_factory_; |
| 60 delete proxy_service_; | 60 delete proxy_service_; |
| 61 } | 61 } |
| 62 }; | 62 }; |
| 63 | 63 |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 544 |
| 545 MessageLoop::current()->Run(); | 545 MessageLoop::current()->Run(); |
| 546 if (request.is_pending()) | 546 if (request.is_pending()) |
| 547 return false; | 547 return false; |
| 548 | 548 |
| 549 return true; | 549 return true; |
| 550 } | 550 } |
| 551 }; | 551 }; |
| 552 | 552 |
| 553 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 553 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
| OLD | NEW |