| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 int64_t size; | 140 int64_t size; |
| 141 | 141 |
| 142 // Seed for the pseudo-random sequence that defines the response body | 142 // Seed for the pseudo-random sequence that defines the response body |
| 143 // contents. The seed is with GetPatternBytes() to generate the body of the | 143 // contents. The seed is with GetPatternBytes() to generate the body of the |
| 144 // response. | 144 // response. |
| 145 int pattern_generator_seed; | 145 int pattern_generator_seed; |
| 146 | 146 |
| 147 // If true, the response contains a 'Accept-Ranges: bytes' header. | 147 // If true, the response contains a 'Accept-Ranges: bytes' header. |
| 148 bool support_byte_ranges; | 148 bool support_byte_ranges; |
| 149 | 149 |
| 150 // The connection type in the response. |
| 151 net::HttpResponseInfo::ConnectionInfo connection_type; |
| 152 |
| 150 // If on_start_handler is valid, it will be invoked when a new request is | 153 // If on_start_handler is valid, it will be invoked when a new request is |
| 151 // received. See details about the OnStartHandler above. | 154 // received. See details about the OnStartHandler above. |
| 152 OnStartHandler on_start_handler; | 155 OnStartHandler on_start_handler; |
| 153 | 156 |
| 154 // Errors to be injected. Each injected error is defined by an offset and an | 157 // Errors to be injected. Each injected error is defined by an offset and an |
| 155 // error. Request handler will successfully fulfil requests to read up to | 158 // error. Request handler will successfully fulfil requests to read up to |
| 156 // |offset|. An attempt to read the byte at |offset| will result in the | 159 // |offset|. An attempt to read the byte at |offset| will result in the |
| 157 // error defined by the InjectErrors object. | 160 // error defined by the InjectErrors object. |
| 158 // | 161 // |
| 159 // If a read spans the range containing |offset|, then the portion of the | 162 // If a read spans the range containing |offset|, then the portion of the |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 class PartialResponseJob; | 318 class PartialResponseJob; |
| 316 | 319 |
| 317 GURL url_; | 320 GURL url_; |
| 318 base::WeakPtr<Interceptor> interceptor_; | 321 base::WeakPtr<Interceptor> interceptor_; |
| 319 DISALLOW_COPY_AND_ASSIGN(TestDownloadRequestHandler); | 322 DISALLOW_COPY_AND_ASSIGN(TestDownloadRequestHandler); |
| 320 }; | 323 }; |
| 321 | 324 |
| 322 } // namespace content | 325 } // namespace content |
| 323 | 326 |
| 324 #endif // CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ | 327 #endif // CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ |
| OLD | NEW |