OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MEDIA_BLINK_TEST_RESPONSE_GENERATOR_H_ | 5 #ifndef MEDIA_BLINK_TEST_RESPONSE_GENERATOR_H_ |
6 #define MEDIA_BLINK_TEST_RESPONSE_GENERATOR_H_ | 6 #define MEDIA_BLINK_TEST_RESPONSE_GENERATOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 int64_t last_byte_offset); | 50 int64_t last_byte_offset); |
51 | 51 |
52 // Generates a custom HTTP 206 response starting from |first_byte_offset| | 52 // Generates a custom HTTP 206 response starting from |first_byte_offset| |
53 // until |last_byte_offset|. You can tweak what gets included in the | 53 // until |last_byte_offset|. You can tweak what gets included in the |
54 // headers via |flags|. | 54 // headers via |flags|. |
55 blink::WebURLResponse GeneratePartial206(int64_t first_byte_offset, | 55 blink::WebURLResponse GeneratePartial206(int64_t first_byte_offset, |
56 int64_t last_byte_offset, | 56 int64_t last_byte_offset, |
57 Flags flags); | 57 Flags flags); |
58 | 58 |
59 // Generates a regular HTTP 404 response. | 59 // Generates a regular HTTP 404 response. |
60 blink::WebURLResponse Generate404(); | 60 blink::WebURLResponse Generate404(int code = 404); |
liberato (no reviews please)
2016/06/18 06:03:14
Perhaps add a new function GenerateResponse(int co
hubbe
2016/06/20 18:59:50
Done.
| |
61 | 61 |
62 // Generates a file:// response starting from |first_byte_offset| until the | 62 // Generates a file:// response starting from |first_byte_offset| until the |
63 // end of the resource. | 63 // end of the resource. |
64 // | 64 // |
65 // If |first_byte_offset| is negative a response containing no content length | 65 // If |first_byte_offset| is negative a response containing no content length |
66 // will be returned. | 66 // will be returned. |
67 blink::WebURLResponse GenerateFileResponse(int64_t first_byte_offset); | 67 blink::WebURLResponse GenerateFileResponse(int64_t first_byte_offset); |
68 | 68 |
69 int64_t content_length() { return content_length_; } | 69 int64_t content_length() { return content_length_; } |
70 | 70 |
71 private: | 71 private: |
72 GURL gurl_; | 72 GURL gurl_; |
73 int64_t content_length_; | 73 int64_t content_length_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(TestResponseGenerator); | 75 DISALLOW_COPY_AND_ASSIGN(TestResponseGenerator); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace media | 78 } // namespace media |
79 | 79 |
80 #endif // MEDIA_BLINK_TEST_RESPONSE_GENERATOR_H_ | 80 #endif // MEDIA_BLINK_TEST_RESPONSE_GENERATOR_H_ |
OLD | NEW |