OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/basictypes.h" | |
6 #include "googleurl/src/gurl.h" | |
7 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" | |
8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | |
9 | |
10 namespace webkit_media { | |
11 | |
12 // Generates WebURLErrors and WebURLResponses suitable for testing purposes. | |
Ami GONE FROM CHROMIUM
2011/11/22 22:06:23
Include "test" in the file & class names?
scherkus (not reviewing)
2011/11/23 04:22:41
Done.
| |
13 class ResponseGenerator { | |
14 public: | |
15 enum Flags { | |
Ami GONE FROM CHROMIUM
2011/11/22 22:06:23
How about some commentary?
TBH, this whole class
scherkus (not reviewing)
2011/11/23 04:22:41
BufferedResourceLoaderTest has lots of crusty resp
| |
16 kNormal = 0, | |
17 kNoAcceptRanges = 1 << 0, | |
18 kNoContentRange = 1 << 1, | |
19 kNoContentLength = 1 << 2, | |
20 }; | |
21 | |
22 ResponseGenerator(const GURL& gurl, int64 content_length); | |
23 | |
24 WebKit::WebURLError GenerateError(); | |
25 WebKit::WebURLResponse Generate200(); | |
26 WebKit::WebURLResponse Generate206(int64 first_byte_offset); | |
27 WebKit::WebURLResponse Generate206(int64 first_byte_offset, Flags flags); | |
28 WebKit::WebURLResponse Generate404(); | |
29 | |
30 const GURL& gurl() { return gurl_; } | |
31 int64 content_length() { return content_length_; } | |
32 | |
33 private: | |
34 GURL gurl_; | |
35 int64 content_length_; | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(ResponseGenerator); | |
38 }; | |
39 | |
40 } // namespace webkit_media | |
OLD | NEW |