OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <windows.h> | 5 #include <windows.h> |
6 #include <wininet.h> | 6 #include <wininet.h> |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/scoped_handle_win.h" | 10 #include "base/scoped_handle_win.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return h_; | 54 return h_; |
55 } | 55 } |
56 | 56 |
57 protected: | 57 protected: |
58 HINTERNET h_; | 58 HINTERNET h_; |
59 }; | 59 }; |
60 | 60 |
61 class URLRequestTestContext : public URLRequestContext { | 61 class URLRequestTestContext : public URLRequestContext { |
62 public: | 62 public: |
63 URLRequestTestContext() { | 63 URLRequestTestContext() { |
64 host_resolver_ = net::CreateSystemHostResolver(NULL); | 64 host_resolver_ = net::CreateSystemHostResolver(); |
65 proxy_service_ = net::ProxyService::CreateNull(); | 65 proxy_service_ = net::ProxyService::CreateNull(); |
66 ssl_config_service_ = new net::SSLConfigServiceDefaults; | 66 ssl_config_service_ = new net::SSLConfigServiceDefaults; |
67 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault(); | 67 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault(); |
68 http_transaction_factory_ = | 68 http_transaction_factory_ = new net::HttpCache( |
69 new net::HttpCache( | 69 net::HttpNetworkLayer::CreateFactory(host_resolver_, proxy_service_, |
70 net::HttpNetworkLayer::CreateFactory(NULL, host_resolver_, | 70 ssl_config_service_, http_auth_handler_factory_, NULL, NULL), |
71 proxy_service_, | 71 net::HttpCache::DefaultBackend::InMemory(0)); |
72 ssl_config_service_, | |
73 http_auth_handler_factory_, | |
74 NULL, | |
75 NULL), | |
76 net::HttpCache::DefaultBackend::InMemory(0)); | |
77 // In-memory cookie store. | 72 // In-memory cookie store. |
78 cookie_store_ = new net::CookieMonster(NULL, NULL); | 73 cookie_store_ = new net::CookieMonster(NULL, NULL); |
79 } | 74 } |
80 | 75 |
81 virtual ~URLRequestTestContext() { | 76 virtual ~URLRequestTestContext() { |
82 delete http_transaction_factory_; | 77 delete http_transaction_factory_; |
83 delete http_auth_handler_factory_; | 78 delete http_auth_handler_factory_; |
84 } | 79 } |
85 }; | 80 }; |
86 | 81 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 EXPECT_EQ(file.accessed(), 1); | 187 EXPECT_EQ(file.accessed(), 1); |
193 EXPECT_EQ(redir.accessed(), 1); | 188 EXPECT_EQ(redir.accessed(), 1); |
194 | 189 |
195 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); | 190 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); |
196 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); | 191 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); |
197 EXPECT_TRUE(goog_task.response().find("<title>") != std::string::npos); | 192 EXPECT_TRUE(goog_task.response().find("<title>") != std::string::npos); |
198 } else { | 193 } else { |
199 ::TerminateThread(worker, ~0); | 194 ::TerminateThread(worker, ~0); |
200 } | 195 } |
201 } | 196 } |
OLD | NEW |