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 callback_; // used for pause and restart. | |
284 | |
285 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; | 283 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; |
286 | 284 |
287 }; | 285 }; |
288 | 286 |
289 class MockNetworkLayer : public HttpTransactionFactory, | 287 class MockNetworkLayer : public HttpTransactionFactory, |
290 public base::SupportsWeakPtr<MockNetworkLayer> { | 288 public base::SupportsWeakPtr<MockNetworkLayer> { |
291 public: | 289 public: |
292 MockNetworkLayer(); | 290 MockNetworkLayer(); |
293 ~MockNetworkLayer() override; | 291 ~MockNetworkLayer() override; |
294 | 292 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 349 |
352 //----------------------------------------------------------------------------- | 350 //----------------------------------------------------------------------------- |
353 // helpers | 351 // helpers |
354 | 352 |
355 // read the transaction completely | 353 // read the transaction completely |
356 int ReadTransaction(HttpTransaction* trans, std::string* result); | 354 int ReadTransaction(HttpTransaction* trans, std::string* result); |
357 | 355 |
358 } // namespace net | 356 } // namespace net |
359 | 357 |
360 #endif // NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_ | 358 #endif // NET_HTTP_HTTP_TRANSACTION_TEST_UTIL_H_ |
OLD | NEW |