diff options
author | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-11 02:36:02 +0000 |
---|---|---|
committer | scherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-11 02:36:02 +0000 |
commit | ef35c45ebac76746e776eec9e79c30821d70853f (patch) | |
tree | 21b021d6ac3be879bf108c33e2a8904dabff6567 /webkit/media/test_response_generator.cc | |
parent | 65b05e976298fd31e6d56f50ea0409677ee27e9e (diff) | |
download | chromium_src-ef35c45ebac76746e776eec9e79c30821d70853f.zip chromium_src-ef35c45ebac76746e776eec9e79c30821d70853f.tar.gz chromium_src-ef35c45ebac76746e776eec9e79c30821d70853f.tar.bz2 |
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
Diffstat (limited to 'webkit/media/test_response_generator.cc')
-rw-r--r-- | webkit/media/test_response_generator.cc | 13 |
1 files changed, 13 insertions, 0 deletions
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 |