diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-29 19:58:36 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-29 19:58:36 +0000 |
commit | 6624b46283f1974b8ea3d3b149763b3dd612359d (patch) | |
tree | a54ba22b3117fc2c6bcf709bcf9866d21b42ce45 /net/base/upload_data_stream_unittest.cc | |
parent | 1683e11834b15dbd4e0e8161a9ed036d78a8d4d7 (diff) | |
download | chromium_src-6624b46283f1974b8ea3d3b149763b3dd612359d.zip chromium_src-6624b46283f1974b8ea3d3b149763b3dd612359d.tar.gz chromium_src-6624b46283f1974b8ea3d3b149763b3dd612359d.tar.bz2 |
Report unreadable files as size zero when uploading.
Upload zero bytes if the file size shrinks.
BUG=30850
TEST=uploading an unreadable file works
Review URL: http://codereview.chromium.org/1250002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/upload_data_stream_unittest.cc')
-rw-r--r-- | net/base/upload_data_stream_unittest.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/base/upload_data_stream_unittest.cc b/net/base/upload_data_stream_unittest.cc index 701bad9..92c065e 100644 --- a/net/base/upload_data_stream_unittest.cc +++ b/net/base/upload_data_stream_unittest.cc @@ -78,7 +78,9 @@ TEST_F(UploadDataStreamTest, FileSmallerThanLength) { read_counter += stream->buf_len(); stream->DidConsume(stream->buf_len()); } - EXPECT_LT(read_counter, stream->size()); + // UpdateDataStream will pad out the file with 0 bytes so that the HTTP + // transaction doesn't hang. Therefore we expected the full size. + EXPECT_EQ(read_counter, stream->size()); file_util::Delete(temp_file_path, false); } |