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 "net/url_request/url_request_test_util.h" | 5 #include "net/url_request/url_request_test_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "net/http/http_network_session.h" | 10 #include "net/http/http_network_session.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 void TestDelegate::OnAuthRequired(net::URLRequest* request, | 174 void TestDelegate::OnAuthRequired(net::URLRequest* request, |
175 net::AuthChallengeInfo* auth_info) { | 175 net::AuthChallengeInfo* auth_info) { |
176 if (!username_.empty() || !password_.empty()) { | 176 if (!username_.empty() || !password_.empty()) { |
177 request->SetAuth(username_, password_); | 177 request->SetAuth(username_, password_); |
178 } else { | 178 } else { |
179 request->CancelAuth(); | 179 request->CancelAuth(); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
| 183 void TestDelegate::OnTLSLoginRequired( |
| 184 net::URLRequest* request, |
| 185 net::AuthChallengeInfo* login_request_info) { |
| 186 } |
| 187 |
183 void TestDelegate::OnSSLCertificateError(net::URLRequest* request, | 188 void TestDelegate::OnSSLCertificateError(net::URLRequest* request, |
184 int cert_error, | 189 int cert_error, |
185 net::X509Certificate* cert) { | 190 net::X509Certificate* cert) { |
186 // The caller can control whether it needs all SSL requests to go through, | 191 // The caller can control whether it needs all SSL requests to go through, |
187 // independent of any possible errors, or whether it wants SSL errors to | 192 // independent of any possible errors, or whether it wants SSL errors to |
188 // cancel the request. | 193 // cancel the request. |
189 have_certificate_errors_ = true; | 194 have_certificate_errors_ = true; |
190 if (allow_certificate_errors_) | 195 if (allow_certificate_errors_) |
191 request->ContinueDespiteLastError(); | 196 request->ContinueDespiteLastError(); |
192 else | 197 else |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 if (!request->status().is_io_pending()) | 276 if (!request->status().is_io_pending()) |
272 OnResponseCompleted(request); | 277 OnResponseCompleted(request); |
273 else if (cancel_in_rd_pending_) | 278 else if (cancel_in_rd_pending_) |
274 request->Cancel(); | 279 request->Cancel(); |
275 } | 280 } |
276 | 281 |
277 void TestDelegate::OnResponseCompleted(net::URLRequest* request) { | 282 void TestDelegate::OnResponseCompleted(net::URLRequest* request) { |
278 if (quit_on_complete_) | 283 if (quit_on_complete_) |
279 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); | 284 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
280 } | 285 } |
OLD | NEW |