Chromium Code Reviews| Index: webkit/media/response_generator.h |
| diff --git a/webkit/media/response_generator.h b/webkit/media/response_generator.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5a934f6beb56ff9fe782887fa4c0ec7ad65e2fe8 |
| --- /dev/null |
| +++ b/webkit/media/response_generator.h |
| @@ -0,0 +1,40 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/basictypes.h" |
| +#include "googleurl/src/gurl.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" |
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" |
| + |
| +namespace webkit_media { |
| + |
| +// 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.
|
| +class ResponseGenerator { |
| + public: |
| + 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
|
| + kNormal = 0, |
| + kNoAcceptRanges = 1 << 0, |
| + kNoContentRange = 1 << 1, |
| + kNoContentLength = 1 << 2, |
| + }; |
| + |
| + ResponseGenerator(const GURL& gurl, int64 content_length); |
| + |
| + WebKit::WebURLError GenerateError(); |
| + WebKit::WebURLResponse Generate200(); |
| + WebKit::WebURLResponse Generate206(int64 first_byte_offset); |
| + WebKit::WebURLResponse Generate206(int64 first_byte_offset, Flags flags); |
| + WebKit::WebURLResponse Generate404(); |
| + |
| + const GURL& gurl() { return gurl_; } |
| + int64 content_length() { return content_length_; } |
| + |
| + private: |
| + GURL gurl_; |
| + int64 content_length_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ResponseGenerator); |
| +}; |
| + |
| +} // namespace webkit_media |