OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/win/scoped_handle.h" | 10 #include "base/win/scoped_handle.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 operator HINTERNET() { | 53 operator HINTERNET() { |
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 net::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, NULL); | 66 NULL, NULL); |
67 cert_verifier_ = new net::CertVerifier; | 67 cert_verifier_ = new net::CertVerifier; |
68 proxy_service_ = net::ProxyService::CreateDirect(); | 68 proxy_service_ = net::ProxyService::CreateDirect(); |
69 ssl_config_service_ = new net::SSLConfigServiceDefaults; | 69 ssl_config_service_ = new net::SSLConfigServiceDefaults; |
70 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( | 70 http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault( |
71 host_resolver_); | 71 host_resolver_); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 EXPECT_EQ(file.accessed(), 1); | 204 EXPECT_EQ(file.accessed(), 1); |
205 EXPECT_EQ(redir.accessed(), 1); | 205 EXPECT_EQ(redir.accessed(), 1); |
206 | 206 |
207 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); | 207 EXPECT_TRUE(person_task.response().find("Guthrie") != std::string::npos); |
208 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); | 208 EXPECT_TRUE(file_task.response().find("function") != std::string::npos); |
209 EXPECT_TRUE(goog_task.response().find("<title>") != std::string::npos); | 209 EXPECT_TRUE(goog_task.response().find("<title>") != std::string::npos); |
210 } else { | 210 } else { |
211 ::TerminateThread(worker, ~0); | 211 ::TerminateThread(worker, ~0); |
212 } | 212 } |
213 } | 213 } |
OLD | NEW |