Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(475)

Unified Diff: webkit/media/response_generator.h

Issue 8649002: Rewrite BufferedDataSource tests to use real BufferedResourceLoader objects. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: bam Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698