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_TEST_UTIL_H_ | 5 #ifndef NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_ |
6 #define NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_ | 6 #define NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 int64_t sent_bytes_; | 273 int64_t sent_bytes_; |
274 | 274 |
275 // NetLog ID of the fake / non-existent underlying socket used by the | 275 // NetLog ID of the fake / non-existent underlying socket used by the |
276 // connection. Requires Start() be passed a NetLogWithSource with a real | 276 // connection. Requires Start() be passed a NetLogWithSource with a real |
277 // NetLog to | 277 // NetLog to |
278 // be initialized. | 278 // be initialized. |
279 unsigned int socket_log_id_; | 279 unsigned int socket_log_id_; |
280 | 280 |
281 bool done_reading_called_; | 281 bool done_reading_called_; |
282 | 282 |
| 283 CompletionCallback resume_start_callback_; // used for pause and restart. |
| 284 |
283 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; | 285 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; |
284 | 286 |
285 }; | 287 }; |
286 | 288 |
287 class MockNetworkLayer : public HttpTransactionFactory, | 289 class MockNetworkLayer : public HttpTransactionFactory, |
288 public base::SupportsWeakPtr<MockNetworkLayer> { | 290 public base::SupportsWeakPtr<MockNetworkLayer> { |
289 public: | 291 public: |
290 MockNetworkLayer(); | 292 MockNetworkLayer(); |
291 ~MockNetworkLayer() override; | 293 ~MockNetworkLayer() override; |
292 | 294 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 351 |
350 //----------------------------------------------------------------------------- | 352 //----------------------------------------------------------------------------- |
351 // helpers | 353 // helpers |
352 | 354 |
353 // read the transaction completely | 355 // read the transaction completely |
354 int ReadTransaction(HttpTransaction* trans, std::string* result); | 356 int ReadTransaction(HttpTransaction* trans, std::string* result); |
355 | 357 |
356 } // namespace net | 358 } // namespace net |
357 | 359 |
358 #endif // NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_ | 360 #endif // NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_ |
OLD | NEW |