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

Side by Side Diff: webkit/media/test_response_generator.cc

Issue 10698139: Write file:// tests for BufferedDataSource and fix some bugs as a result. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: what the Created 8 years, 5 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/media/test_response_generator.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "webkit/media/test_response_generator.h" 5 #include "webkit/media/test_response_generator.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 return response; 79 return response;
80 } 80 }
81 81
82 WebURLResponse TestResponseGenerator::Generate404() { 82 WebURLResponse TestResponseGenerator::Generate404() {
83 WebURLResponse response(gurl_); 83 WebURLResponse response(gurl_);
84 response.setHTTPStatusCode(404); 84 response.setHTTPStatusCode(404);
85 return response; 85 return response;
86 } 86 }
87 87
88 WebURLResponse TestResponseGenerator::GenerateFileResponse(
89 int64 first_byte_offset) {
90 WebURLResponse response(gurl_);
91 response.setHTTPStatusCode(0);
92
93 if (first_byte_offset >= 0) {
94 response.setExpectedContentLength(content_length_ - first_byte_offset);
95 } else {
96 response.setExpectedContentLength(-1);
97 }
98 return response;
99 }
100
88 } // namespace webkit_media 101 } // namespace webkit_media
OLDNEW
« no previous file with comments | « webkit/media/test_response_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698