From ef35c45ebac76746e776eec9e79c30821d70853f Mon Sep 17 00:00:00 2001 From: "scherkus@chromium.org" Date: Wed, 11 Jul 2012 02:36:02 +0000 Subject: Write file:// tests for BufferedDataSource and fix some bugs as a result. It turns out we had two bugs in our non-HTTP code path: 1) Connection retries used the wrong start callback, which caused the loader to never get created 2) The start position for non-HTTP resources is kPositionNotSpecified, which caused us to report [-1, file size) instead of [0, file size) for buffered status BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10698139 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146035 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/media/test_response_generator.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'webkit/media/test_response_generator.cc') diff --git a/webkit/media/test_response_generator.cc b/webkit/media/test_response_generator.cc index d5485b3..b2d605c 100644 --- a/webkit/media/test_response_generator.cc +++ b/webkit/media/test_response_generator.cc @@ -85,4 +85,17 @@ WebURLResponse TestResponseGenerator::Generate404() { return response; } +WebURLResponse TestResponseGenerator::GenerateFileResponse( + int64 first_byte_offset) { + WebURLResponse response(gurl_); + response.setHTTPStatusCode(0); + + if (first_byte_offset >= 0) { + response.setExpectedContentLength(content_length_ - first_byte_offset); + } else { + response.setExpectedContentLength(-1); + } + return response; +} + } // namespace webkit_media -- cgit v1.1