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

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

Issue 10692154: gdata: Remove IsCache/SetCache/ClearCache* functions from GDataCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 5 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_unittest.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_file_system_unittest.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc b/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
index 9f1df6cff096fa6d69823e70182e165423dc25b3..168304929e459595ad9ea5b0687f524d4df6b72d 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
@@ -122,7 +122,12 @@ ACTION_P4(MockUploadExistingFile,
return kUploadId;
}
-} // anonymous namespace
+// Converts |cache_state| to a GDataCache::CacheEntry.
+GDataCache::CacheEntry ToCacheEntry(int cache_state) {
+ return GDataCache::CacheEntry("dummy_md5", cache_state);
+}
+
+} // namespace
class MockFreeDiskSpaceGetter : public FreeDiskSpaceGetterInterface {
public:
@@ -699,8 +704,8 @@ class GDataFileSystemTest : public testing::Test {
// Verify cache map.
scoped_ptr<GDataCache::CacheEntry> cache_entry =
GetCacheEntryFromOriginThread(resource_id, md5);
- if (GDataCache::IsCachePresent(expected_cache_state_) ||
- GDataCache::IsCachePinned(expected_cache_state_)) {
+ if (ToCacheEntry(expected_cache_state_).IsPresent() ||
+ ToCacheEntry(expected_cache_state_).IsPinned()) {
ASSERT_TRUE(cache_entry.get());
EXPECT_EQ(expected_cache_state_, cache_entry->cache_state);
EXPECT_EQ(expected_sub_dir_type_, cache_entry->GetSubDirectoryType());
@@ -712,15 +717,15 @@ class GDataFileSystemTest : public testing::Test {
FilePath dest_path = cache_->GetCacheFilePath(
resource_id,
md5,
- GDataCache::IsCachePinned(expected_cache_state_) ||
- GDataCache::IsCacheDirty(expected_cache_state_) ?
+ ToCacheEntry(expected_cache_state_).IsPinned() ||
+ ToCacheEntry(expected_cache_state_).IsDirty() ?
GDataCache::CACHE_TYPE_PERSISTENT :
GDataCache::CACHE_TYPE_TMP,
- GDataCache::IsCacheDirty(expected_cache_state_) ?
+ ToCacheEntry(expected_cache_state_).IsDirty() ?
GDataCache::CACHED_FILE_LOCALLY_MODIFIED :
GDataCache::CACHED_FILE_FROM_SERVER);
bool exists = file_util::PathExists(dest_path);
- if (GDataCache::IsCachePresent(expected_cache_state_))
+ if (ToCacheEntry(expected_cache_state_).IsPresent())
EXPECT_TRUE(exists);
else
EXPECT_FALSE(exists);
@@ -733,11 +738,11 @@ class GDataFileSystemTest : public testing::Test {
GDataCache::CACHED_FILE_FROM_SERVER);
// Check that pin symlink exists, without deferencing to target path.
exists = file_util::IsLink(symlink_path);
- if (GDataCache::IsCachePinned(expected_cache_state_)) {
+ if (ToCacheEntry(expected_cache_state_).IsPinned()) {
EXPECT_TRUE(exists);
FilePath target_path;
EXPECT_TRUE(file_util::ReadSymbolicLink(symlink_path, &target_path));
- if (GDataCache::IsCachePresent(expected_cache_state_))
+ if (ToCacheEntry(expected_cache_state_).IsPresent())
EXPECT_EQ(dest_path, target_path);
else
EXPECT_EQ(kSymLinkToDevNull, target_path.value());
@@ -754,12 +759,12 @@ class GDataFileSystemTest : public testing::Test {
// Check that outgoing symlink exists, without deferencing to target path.
exists = file_util::IsLink(symlink_path);
if (expect_outgoing_symlink_ &&
- GDataCache::IsCacheDirty(expected_cache_state_)) {
+ ToCacheEntry(expected_cache_state_).IsDirty()) {
EXPECT_TRUE(exists);
FilePath target_path;
EXPECT_TRUE(file_util::ReadSymbolicLink(symlink_path, &target_path));
EXPECT_TRUE(target_path.value() != kSymLinkToDevNull);
- if (GDataCache::IsCachePresent(expected_cache_state_))
+ if (ToCacheEntry(expected_cache_state_).IsPresent())
EXPECT_EQ(dest_path, target_path);
} else {
EXPECT_FALSE(exists);
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_cache_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698