OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/http/http_transaction_test_util.h" | 5 #include "net/http/http_transaction_test_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
15 #include "base/time/clock.h" | 15 #include "base/time/clock.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "net/base/load_flags.h" | 17 #include "net/base/load_flags.h" |
18 #include "net/base/load_timing_info.h" | 18 #include "net/base/load_timing_info.h" |
19 #include "net/base/net_errors.h" | 19 #include "net/base/net_errors.h" |
20 #include "net/cert/x509_certificate.h" | 20 #include "net/cert/x509_certificate.h" |
21 #include "net/disk_cache/disk_cache.h" | 21 #include "net/disk_cache/disk_cache.h" |
22 #include "net/http/http_cache.h" | 22 #include "net/http/http_cache.h" |
23 #include "net/http/http_request_info.h" | 23 #include "net/http/http_request_info.h" |
24 #include "net/http/http_response_info.h" | 24 #include "net/http/http_response_info.h" |
25 #include "net/http/http_transaction.h" | 25 #include "net/http/http_transaction.h" |
26 #include "net/ssl/ssl_private_key.h" | |
davidben
2015/09/25 20:10:11
Not necessary
svaldez
2015/09/28 16:54:52
Done.
| |
26 #include "testing/gtest/include/gtest/gtest.h" | 27 #include "testing/gtest/include/gtest/gtest.h" |
27 | 28 |
28 namespace net { | 29 namespace net { |
29 | 30 |
30 namespace { | 31 namespace { |
31 typedef base::hash_map<std::string, const MockTransaction*> MockTransactionMap; | 32 typedef base::hash_map<std::string, const MockTransaction*> MockTransactionMap; |
32 static MockTransactionMap mock_transactions; | 33 static MockTransactionMap mock_transactions; |
33 } // namespace | 34 } // namespace |
34 | 35 |
35 //----------------------------------------------------------------------------- | 36 //----------------------------------------------------------------------------- |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 return StartInternal(request, callback, net_log); | 259 return StartInternal(request, callback, net_log); |
259 } | 260 } |
260 | 261 |
261 int MockNetworkTransaction::RestartIgnoringLastError( | 262 int MockNetworkTransaction::RestartIgnoringLastError( |
262 const CompletionCallback& callback) { | 263 const CompletionCallback& callback) { |
263 return ERR_FAILED; | 264 return ERR_FAILED; |
264 } | 265 } |
265 | 266 |
266 int MockNetworkTransaction::RestartWithCertificate( | 267 int MockNetworkTransaction::RestartWithCertificate( |
267 X509Certificate* client_cert, | 268 X509Certificate* client_cert, |
269 SSLPrivateKey* client_pkey, | |
268 const CompletionCallback& callback) { | 270 const CompletionCallback& callback) { |
269 return ERR_FAILED; | 271 return ERR_FAILED; |
270 } | 272 } |
271 | 273 |
272 int MockNetworkTransaction::RestartWithAuth( | 274 int MockNetworkTransaction::RestartWithAuth( |
273 const AuthCredentials& credentials, | 275 const AuthCredentials& credentials, |
274 const CompletionCallback& callback) { | 276 const CompletionCallback& callback) { |
275 if (!IsReadyToRestartForAuth()) | 277 if (!IsReadyToRestartForAuth()) |
276 return ERR_FAILED; | 278 return ERR_FAILED; |
277 | 279 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
551 content.append(buf->data(), rv); | 553 content.append(buf->data(), rv); |
552 else if (rv < 0) | 554 else if (rv < 0) |
553 return rv; | 555 return rv; |
554 } while (rv > 0); | 556 } while (rv > 0); |
555 | 557 |
556 result->swap(content); | 558 result->swap(content); |
557 return OK; | 559 return OK; |
558 } | 560 } |
559 | 561 |
560 } // namespace net | 562 } // namespace net |
OLD | NEW |