| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_ = | 64 host_resolver_ = |
| 65 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, | 65 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, |
| 66 NULL); | 66 NULL); |
| 67 proxy_service_ = net::ProxyService::CreateDirect(); | 67 proxy_service_ = net::ProxyService::CreateDirect(); |
| 68 ssl_config_service_ = new net::SSLConfigServiceDefaults; | 68 ssl_config_service_ = new net::SSLConfigServiceDefaults; |
| 69 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault(); | 69 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( |
| 70 host_resolver_); |
| 70 http_transaction_factory_ = new net::HttpCache( | 71 http_transaction_factory_ = new net::HttpCache( |
| 71 net::HttpNetworkLayer::CreateFactory(host_resolver_, proxy_service_, | 72 net::HttpNetworkLayer::CreateFactory(host_resolver_, proxy_service_, |
| 72 ssl_config_service_, http_auth_handler_factory_, NULL, NULL), | 73 ssl_config_service_, http_auth_handler_factory_, NULL, NULL), |
| 73 net::HttpCache::DefaultBackend::InMemory(0)); | 74 net::HttpCache::DefaultBackend::InMemory(0)); |
| 74 // In-memory cookie store. | 75 // In-memory cookie store. |
| 75 cookie_store_ = new net::CookieMonster(NULL, NULL); | 76 cookie_store_ = new net::CookieMonster(NULL, NULL); |
| 76 } | 77 } |
| 77 | 78 |
| 78 virtual ~URLRequestTestContext() { | 79 virtual ~URLRequestTestContext() { |
| 79 delete http_transaction_factory_; | 80 delete http_transaction_factory_; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 EXPECT_EQ(file.accessed(), 1); | 190 EXPECT_EQ(file.accessed(), 1); |
| 190 EXPECT_EQ(redir.accessed(), 1); | 191 EXPECT_EQ(redir.accessed(), 1); |
| 191 | 192 |
| 192 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); | 193 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); |
| 193 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); | 194 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); |
| 194 EXPECT_TRUE(goog_task.response().find("<title>") != std::string::npos); | 195 EXPECT_TRUE(goog_task.response().find("<title>") != std::string::npos); |
| 195 } else { | 196 } else { |
| 196 ::TerminateThread(worker, ~0); | 197 ::TerminateThread(worker, ~0); |
| 197 } | 198 } |
| 198 } | 199 } |
| OLD | NEW |