Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Unified Diff: chrome/browser/chromeos/gdata/gdata_cache_unittest.cc

Issue 10854110: Revert 151238 - Check for space before storing files to the cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_cache.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_cache_unittest.cc
===================================================================
--- chrome/browser/chromeos/gdata/gdata_cache_unittest.cc (revision 151240)
+++ chrome/browser/chromeos/gdata/gdata_cache_unittest.cc (working copy)
@@ -809,9 +809,6 @@
}
TEST_F(GDataCacheTest, StoreToCacheSimple) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
@@ -844,9 +841,6 @@
}
TEST_F(GDataCacheTest, GetFromCacheSimple) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
// First store a file to cache.
@@ -877,9 +871,6 @@
}
TEST_F(GDataCacheTest, RemoveFromCacheSimple) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
// Use alphanumeric characters for resource id.
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
@@ -979,9 +970,6 @@
}
TEST_F(GDataCacheTest, StoreToCachePinned) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
EXPECT_CALL(*mock_cache_observer_, OnCachePinned(resource_id, md5)).Times(1);
@@ -1013,9 +1001,6 @@
}
TEST_F(GDataCacheTest, GetFromCachePinned) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
EXPECT_CALL(*mock_cache_observer_, OnCachePinned(resource_id, md5)).Times(1);
@@ -1047,9 +1032,6 @@
}
TEST_F(GDataCacheTest, RemoveFromCachePinned) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
// Use alphanumeric characters for resource_id.
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
@@ -1090,9 +1072,6 @@
}
TEST_F(GDataCacheTest, DirtyCacheSimple) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
EXPECT_CALL(*mock_cache_observer_, OnCacheCommitted(resource_id)).Times(1);
@@ -1129,9 +1108,6 @@
}
TEST_F(GDataCacheTest, DirtyCachePinned) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
EXPECT_CALL(*mock_cache_observer_, OnCachePinned(resource_id, md5)).Times(1);
@@ -1229,9 +1205,6 @@
}
TEST_F(GDataCacheTest, DirtyCacheRepetitive) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
EXPECT_CALL(*mock_cache_observer_, OnCacheCommitted(resource_id)).Times(3);
@@ -1312,9 +1285,6 @@
}
TEST_F(GDataCacheTest, DirtyCacheInvalid) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
@@ -1377,9 +1347,6 @@
}
TEST_F(GDataCacheTest, RemoveFromDirtyCache) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
EXPECT_CALL(*mock_cache_observer_, OnCachePinned(resource_id, md5)).Times(1);
@@ -1415,9 +1382,6 @@
}
TEST_F(GDataCacheTest, MountUnmount) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
FilePath file_path;
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
@@ -1515,9 +1479,6 @@
TEST_F(GDataCacheTest, ClearAllOnUIThread) {
PrepareForInitCacheTest();
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(kLotsOfSpace));
-
std::string resource_id("pdf:1a2b");
std::string md5("abcdef0123456789");
@@ -1544,23 +1505,4 @@
EXPECT_EQ(0U, CountCacheFiles(resource_id, md5));
}
-TEST_F(GDataCacheTest, StoreToCacheNoSpace) {
- EXPECT_CALL(*mock_free_disk_space_checker_, AmountOfFreeDiskSpace())
- .Times(AtLeast(1)).WillRepeatedly(Return(0));
-
- std::string resource_id("pdf:1a2b");
- std::string md5("abcdef0123456789");
-
- // Try to store an existing file.
- TestStoreToCache(resource_id, md5, GetTestFilePath("root_feed.json"),
- GDATA_FILE_ERROR_NO_SPACE,
- test_util::TEST_CACHE_STATE_NONE,
- GDataCache::CACHE_TYPE_TMP);
- EXPECT_EQ(1, num_callback_invocations_);
-
- // Verify that there's no files added.
- EXPECT_EQ(0U, CountCacheFiles(resource_id, md5));
-}
-
-
} // namespace gdata
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698