| 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 #ifndef NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 5 #ifndef NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| 6 #define NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 6 #define NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| 7 | 7 |
| 8 #include "net/http/http_transaction.h" | 8 #include "net/http/http_transaction.h" |
| 9 | 9 |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "net/http/http_request_info.h" | 25 #include "net/http/http_request_info.h" |
| 26 #include "net/http/http_response_headers.h" | 26 #include "net/http/http_response_headers.h" |
| 27 #include "net/http/http_response_info.h" | 27 #include "net/http/http_response_info.h" |
| 28 #include "net/log/net_log.h" | 28 #include "net/log/net_log.h" |
| 29 #include "net/socket/connection_attempts.h" | 29 #include "net/socket/connection_attempts.h" |
| 30 | 30 |
| 31 namespace net { | 31 namespace net { |
| 32 | 32 |
| 33 class HttpRequestHeaders; | 33 class HttpRequestHeaders; |
| 34 class IOBuffer; | 34 class IOBuffer; |
| 35 class SSLPrivateKey; |
| 35 class X509Certificate; | 36 class X509Certificate; |
| 36 struct HttpRequestInfo; | 37 struct HttpRequestInfo; |
| 37 | 38 |
| 38 //----------------------------------------------------------------------------- | 39 //----------------------------------------------------------------------------- |
| 39 // mock transaction data | 40 // mock transaction data |
| 40 | 41 |
| 41 // these flags may be combined to form the test_mode field | 42 // these flags may be combined to form the test_mode field |
| 42 enum { | 43 enum { |
| 43 TEST_MODE_NORMAL = 0, | 44 TEST_MODE_NORMAL = 0, |
| 44 TEST_MODE_SYNC_NET_START = 1 << 0, | 45 TEST_MODE_SYNC_NET_START = 1 << 0, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 MockNetworkTransaction(RequestPriority priority, MockNetworkLayer* factory); | 176 MockNetworkTransaction(RequestPriority priority, MockNetworkLayer* factory); |
| 176 ~MockNetworkTransaction() override; | 177 ~MockNetworkTransaction() override; |
| 177 | 178 |
| 178 int Start(const HttpRequestInfo* request, | 179 int Start(const HttpRequestInfo* request, |
| 179 const CompletionCallback& callback, | 180 const CompletionCallback& callback, |
| 180 const BoundNetLog& net_log) override; | 181 const BoundNetLog& net_log) override; |
| 181 | 182 |
| 182 int RestartIgnoringLastError(const CompletionCallback& callback) override; | 183 int RestartIgnoringLastError(const CompletionCallback& callback) override; |
| 183 | 184 |
| 184 int RestartWithCertificate(X509Certificate* client_cert, | 185 int RestartWithCertificate(X509Certificate* client_cert, |
| 186 SSLPrivateKey* client_private_key, |
| 185 const CompletionCallback& callback) override; | 187 const CompletionCallback& callback) override; |
| 186 | 188 |
| 187 int RestartWithAuth(const AuthCredentials& credentials, | 189 int RestartWithAuth(const AuthCredentials& credentials, |
| 188 const CompletionCallback& callback) override; | 190 const CompletionCallback& callback) override; |
| 189 | 191 |
| 190 bool IsReadyToRestartForAuth() override; | 192 bool IsReadyToRestartForAuth() override; |
| 191 | 193 |
| 192 int Read(IOBuffer* buf, | 194 int Read(IOBuffer* buf, |
| 193 int buf_len, | 195 int buf_len, |
| 194 const CompletionCallback& callback) override; | 196 const CompletionCallback& callback) override; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 | 331 |
| 330 //----------------------------------------------------------------------------- | 332 //----------------------------------------------------------------------------- |
| 331 // helpers | 333 // helpers |
| 332 | 334 |
| 333 // read the transaction completely | 335 // read the transaction completely |
| 334 int ReadTransaction(HttpTransaction* trans, std::string* result); | 336 int ReadTransaction(HttpTransaction* trans, std::string* result); |
| 335 | 337 |
| 336 } // namespace net | 338 } // namespace net |
| 337 | 339 |
| 338 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 340 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| OLD | NEW |