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> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/platform_thread.h" | 17 #include "base/platform_thread.h" |
18 #include "base/process_util.h" | 18 #include "base/process_util.h" |
19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
20 #include "base/thread.h" | 20 #include "base/thread.h" |
21 #include "base/time.h" | 21 #include "base/time.h" |
22 #include "base/waitable_event.h" | 22 #include "base/waitable_event.h" |
23 #include "net/base/net_errors.h" | 23 #include "net/base/net_errors.h" |
24 #include "net/http/http_network_layer.h" | 24 #include "net/http/http_network_layer.h" |
25 #include "net/url_request/url_request.h" | 25 #include "net/url_request/url_request.h" |
26 #include "net/proxy/proxy_resolver_null.h" | |
27 #include "net/proxy/proxy_service.h" | 26 #include "net/proxy/proxy_service.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
29 #include "googleurl/src/url_util.h" | 28 #include "googleurl/src/url_util.h" |
30 | 29 |
31 const int kDefaultPort = 1337; | 30 const int kDefaultPort = 1337; |
32 const std::string kDefaultHostName("localhost"); | 31 const std::string kDefaultHostName("localhost"); |
33 | 32 |
34 // This URLRequestContext does not use a local cache. | 33 // This URLRequestContext does not use a local cache. |
35 class TestURLRequestContext : public URLRequestContext { | 34 class TestURLRequestContext : public URLRequestContext { |
36 public: | 35 public: |
37 TestURLRequestContext() { | 36 TestURLRequestContext() { |
38 proxy_service_ = new net::ProxyService(new net::ProxyResolverNull); | 37 proxy_service_ = net::ProxyService::CreateNull(); |
39 http_transaction_factory_ = | 38 http_transaction_factory_ = |
40 net::HttpNetworkLayer::CreateFactory(proxy_service_); | 39 net::HttpNetworkLayer::CreateFactory(proxy_service_); |
41 } | 40 } |
42 | 41 |
43 virtual ~TestURLRequestContext() { | 42 virtual ~TestURLRequestContext() { |
44 delete http_transaction_factory_; | 43 delete http_transaction_factory_; |
45 delete proxy_service_; | 44 delete proxy_service_; |
46 } | 45 } |
47 }; | 46 }; |
48 | 47 |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 const std::wstring& document_root, | 438 const std::wstring& document_root, |
440 const std::wstring& cert_path) : TestServer(ManualInit()) { | 439 const std::wstring& cert_path) : TestServer(ManualInit()) { |
441 Init(host_name, port, document_root, cert_path); | 440 Init(host_name, port, document_root, cert_path); |
442 } | 441 } |
443 | 442 |
444 virtual std::string scheme() { return std::string("https"); } | 443 virtual std::string scheme() { return std::string("https"); } |
445 }; | 444 }; |
446 | 445 |
447 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ | 446 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ |
448 | 447 |
OLD | NEW |