| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 net::ProxyConfig proxy_config; | 55 net::ProxyConfig proxy_config; |
| 56 proxy_config.proxy_rules.ParseFromString(proxy); | 56 proxy_config.proxy_rules.ParseFromString(proxy); |
| 57 proxy_service_ = net::ProxyService::CreateFixed(proxy_config); | 57 proxy_service_ = net::ProxyService::CreateFixed(proxy_config); |
| 58 http_transaction_factory_ = | 58 http_transaction_factory_ = |
| 59 net::HttpNetworkLayer::CreateFactory(host_resolver_, | 59 net::HttpNetworkLayer::CreateFactory(host_resolver_, |
| 60 proxy_service_); | 60 proxy_service_); |
| 61 } | 61 } |
| 62 | 62 |
| 63 virtual ~TestURLRequestContext() { | 63 virtual ~TestURLRequestContext() { |
| 64 delete http_transaction_factory_; | 64 delete http_transaction_factory_; |
| 65 delete proxy_service_; | |
| 66 } | 65 } |
| 67 }; | 66 }; |
| 68 | 67 |
| 69 class TestDelegate : public URLRequest::Delegate { | 68 class TestDelegate : public URLRequest::Delegate { |
| 70 public: | 69 public: |
| 71 TestDelegate() | 70 TestDelegate() |
| 72 : cancel_in_rr_(false), | 71 : cancel_in_rr_(false), |
| 73 cancel_in_rs_(false), | 72 cancel_in_rs_(false), |
| 74 cancel_in_rd_(false), | 73 cancel_in_rd_(false), |
| 75 cancel_in_rd_pending_(false), | 74 cancel_in_rd_pending_(false), |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 604 |
| 606 MessageLoop::current()->Run(); | 605 MessageLoop::current()->Run(); |
| 607 if (request.is_pending()) | 606 if (request.is_pending()) |
| 608 return false; | 607 return false; |
| 609 | 608 |
| 610 return true; | 609 return true; |
| 611 } | 610 } |
| 612 }; | 611 }; |
| 613 | 612 |
| 614 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 613 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
| OLD | NEW |