From e8c927ab11958c3d1d7c768674795bcbc8b67bbb Mon Sep 17 00:00:00 2001 From: "eroman@chromium.org" Date: Tue, 22 Sep 2009 00:04:29 +0000 Subject: 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 --- net/http/http_cache_unittest.cc | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'net/http/http_cache_unittest.cc') 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), -- cgit v1.1