| 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/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 void TestDelegate::OnAuthRequired(net::URLRequest* request, | 186 void TestDelegate::OnAuthRequired(net::URLRequest* request, |
| 187 net::AuthChallengeInfo* auth_info) { | 187 net::AuthChallengeInfo* auth_info) { |
| 188 if (!username_.empty() || !password_.empty()) { | 188 if (!username_.empty() || !password_.empty()) { |
| 189 request->SetAuth(username_, password_); | 189 request->SetAuth(username_, password_); |
| 190 } else { | 190 } else { |
| 191 request->CancelAuth(); | 191 request->CancelAuth(); |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 void TestDelegate::OnSSLCertificateError(net::URLRequest* request, | 195 void TestDelegate::OnSSLCertificateError(net::URLRequest* request, |
| 196 int cert_error, | 196 const net::SSLInfo& ssl_info, |
| 197 net::X509Certificate* cert) { | 197 bool is_hsts_host) { |
| 198 // The caller can control whether it needs all SSL requests to go through, | 198 // The caller can control whether it needs all SSL requests to go through, |
| 199 // independent of any possible errors, or whether it wants SSL errors to | 199 // independent of any possible errors, or whether it wants SSL errors to |
| 200 // cancel the request. | 200 // cancel the request. |
| 201 have_certificate_errors_ = true; | 201 have_certificate_errors_ = true; |
| 202 if (allow_certificate_errors_) | 202 if (allow_certificate_errors_) |
| 203 request->ContinueDespiteLastError(); | 203 request->ContinueDespiteLastError(); |
| 204 else | 204 else |
| 205 request->Cancel(); | 205 request->Cancel(); |
| 206 } | 206 } |
| 207 | 207 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 } | 454 } |
| 455 | 455 |
| 456 void TestNetworkDelegate::OnPACScriptError(int line_number, | 456 void TestNetworkDelegate::OnPACScriptError(int line_number, |
| 457 const string16& error) { | 457 const string16& error) { |
| 458 } | 458 } |
| 459 | 459 |
| 460 void TestNetworkDelegate::OnAuthRequired( | 460 void TestNetworkDelegate::OnAuthRequired( |
| 461 net::URLRequest* reqest, | 461 net::URLRequest* reqest, |
| 462 const net::AuthChallengeInfo& auth_info) { | 462 const net::AuthChallengeInfo& auth_info) { |
| 463 } | 463 } |
| OLD | NEW |