summaryrefslogtreecommitdiffstats
path: root/net/http/http_cache_unittest.cc
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-22 00:04:29 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-22 00:04:29 +0000
commite8c927ab11958c3d1d7c768674795bcbc8b67bbb (patch)
treedb4e04e6398a31e4129ea6abfe8bbeab4a4be174 /net/http/http_cache_unittest.cc
parent7f6135589837c30d13e0d60480f44df33db2fec2 (diff)
downloadchromium_src-e8c927ab11958c3d1d7c768674795bcbc8b67bbb.zip
chromium_src-e8c927ab11958c3d1d7c768674795bcbc8b67bbb.tar.gz
chromium_src-e8c927ab11958c3d1d7c768674795bcbc8b67bbb.tar.bz2
Revert 25873.
This appears to be responsible for a regression in downloading of files. BUG=http://crbug.com/406 TBR=darin Review URL: http://codereview.chromium.org/215035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache_unittest.cc')
-rw-r--r--net/http/http_cache_unittest.cc19
1 files changed, 4 insertions, 15 deletions
diff --git a/net/http/http_cache_unittest.cc b/net/http/http_cache_unittest.cc
index 2cd5154..aada69b 100644
--- a/net/http/http_cache_unittest.cc
+++ b/net/http/http_cache_unittest.cc
@@ -126,12 +126,7 @@ class MockDiskEntry : public disk_cache::Entry,
data_[index].resize(offset + buf_len);
if (buf_len)
memcpy(&data_[index][offset], buf->data(), buf_len);
-
- if (!callback || (test_mode_ & TEST_MODE_SYNC_CACHE_WRITE))
- return buf_len;
-
- CallbackLater(callback, buf_len);
- return net::ERR_IO_PENDING;
+ return buf_len;
}
virtual int ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len,
@@ -182,11 +177,7 @@ class MockDiskEntry : public disk_cache::Entry,
data_[1].resize(real_offset + buf_len);
memcpy(&data_[1][real_offset], buf->data(), buf_len);
- if (!completion_callback || (test_mode_ & TEST_MODE_SYNC_CACHE_WRITE))
- return buf_len;
-
- CallbackLater(completion_callback, buf_len);
- return net::ERR_IO_PENDING;
+ return buf_len;
}
virtual int GetAvailableRange(int64 offset, int len, int64* start) {
@@ -1978,8 +1969,7 @@ TEST(HttpCache, UnknownRangeGET_2) {
MockTransaction transaction(kRangeGET_TransactionOK);
transaction.test_mode = TEST_MODE_SYNC_CACHE_START |
- TEST_MODE_SYNC_CACHE_READ |
- TEST_MODE_SYNC_CACHE_WRITE;
+ TEST_MODE_SYNC_CACHE_READ;
AddMockTransaction(&transaction);
// Write to the cache (70-79).
@@ -2544,8 +2534,7 @@ TEST(HttpCache, SyncRead) {
ScopedMockTransaction transaction(kSimpleGET_Transaction);
transaction.test_mode |= (TEST_MODE_SYNC_CACHE_START |
- TEST_MODE_SYNC_CACHE_READ |
- TEST_MODE_SYNC_CACHE_WRITE);
+ TEST_MODE_SYNC_CACHE_READ);
MockHttpRequest r1(transaction),
r2(transaction),