| 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> |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 #include "base/time/time.h" |
| 18 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
| 19 #include "net/base/load_flags.h" | 20 #include "net/base/load_flags.h" |
| 20 #include "net/base/net_error_details.h" | 21 #include "net/base/net_error_details.h" |
| 21 #include "net/base/net_errors.h" | 22 #include "net/base/net_errors.h" |
| 22 #include "net/base/request_priority.h" | 23 #include "net/base/request_priority.h" |
| 23 #include "net/base/test_completion_callback.h" | 24 #include "net/base/test_completion_callback.h" |
| 24 #include "net/disk_cache/disk_cache.h" | 25 #include "net/disk_cache/disk_cache.h" |
| 25 #include "net/http/http_cache.h" | 26 #include "net/http/http_cache.h" |
| 26 #include "net/http/http_request_info.h" | 27 #include "net/http/http_request_info.h" |
| 27 #include "net/http/http_response_headers.h" | 28 #include "net/http/http_response_headers.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 int64_t sent_bytes_; | 274 int64_t sent_bytes_; |
| 274 | 275 |
| 275 // NetLog ID of the fake / non-existent underlying socket used by the | 276 // NetLog ID of the fake / non-existent underlying socket used by the |
| 276 // connection. Requires Start() be passed a NetLogWithSource with a real | 277 // connection. Requires Start() be passed a NetLogWithSource with a real |
| 277 // NetLog to | 278 // NetLog to |
| 278 // be initialized. | 279 // be initialized. |
| 279 unsigned int socket_log_id_; | 280 unsigned int socket_log_id_; |
| 280 | 281 |
| 281 bool done_reading_called_; | 282 bool done_reading_called_; |
| 282 | 283 |
| 284 base::TimeTicks start_time_; |
| 285 |
| 283 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; | 286 base::WeakPtrFactory<MockNetworkTransaction> weak_factory_; |
| 284 | 287 |
| 285 }; | 288 }; |
| 286 | 289 |
| 287 class MockNetworkLayer : public HttpTransactionFactory, | 290 class MockNetworkLayer : public HttpTransactionFactory, |
| 288 public base::SupportsWeakPtr<MockNetworkLayer> { | 291 public base::SupportsWeakPtr<MockNetworkLayer> { |
| 289 public: | 292 public: |
| 290 MockNetworkLayer(); | 293 MockNetworkLayer(); |
| 291 ~MockNetworkLayer() override; | 294 ~MockNetworkLayer() override; |
| 292 | 295 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 352 |
| 350 //----------------------------------------------------------------------------- | 353 //----------------------------------------------------------------------------- |
| 351 // helpers | 354 // helpers |
| 352 | 355 |
| 353 // read the transaction completely | 356 // read the transaction completely |
| 354 int ReadTransaction(HttpTransaction* trans, std::string* result); | 357 int ReadTransaction(HttpTransaction* trans, std::string* result); |
| 355 | 358 |
| 356 } // namespace net | 359 } // namespace net |
| 357 | 360 |
| 358 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ | 361 #endif // NET_HTTP_HTTP_TRANSACTION_UNITTEST_H_ |
| OLD | NEW |