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

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

Issue 10182009: gdata: Remove GDataFileSystem::GetFileFromCacheByPath() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better solution Created 8 years, 8 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
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 d694b59f31c99caa153a4d556627333b861223d6..2220f2331d6c9cb7d9f378d0ceb3880460d35eb6 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
@@ -364,18 +364,6 @@ class GDataFileSystemTest : public testing::Test {
RunAllPendingForIO();
}
- void TestGetFileFromCacheByPath(const FilePath& gdata_file_path,
- base::PlatformFileError expected_error) {
- expected_error_ = expected_error;
- expected_file_extension_.clear();
-
- file_system_->GetFileFromCacheByPath(gdata_file_path,
- base::Bind(&GDataFileSystemTest::VerifyGetFromCache,
- base::Unretained(this)));
-
- RunAllPendingForIO();
- }
-
void VerifyGetFromCache(base::PlatformFileError error,
const std::string& resource_id,
const std::string& md5,
@@ -2625,51 +2613,6 @@ TEST_F(GDataFileSystemTest, GetGDataEntryByPath) {
ASSERT_TRUE(non_existent == NULL);
}
-TEST_F(GDataFileSystemTest, GetFileFromCacheByPath) {
- EXPECT_CALL(*mock_sync_client_, OnCacheInitialized()).Times(1);
-
- LoadRootFeedDocument("root_feed.json");
-
- // First make sure the file exists in GData.
- FilePath gdata_file_path = FilePath(FILE_PATH_LITERAL("gdata/File 1.txt"));
- GDataFile* file = NULL;
- { // Lock to call GetGDataEntryByPath.
- base::AutoLock lock(file_system_->lock_);
- GDataEntry* entry =
- file_system_->GetGDataEntryByPath(gdata_file_path);
- ASSERT_TRUE(entry != NULL);
- file = entry->AsGDataFile();
- ASSERT_TRUE(file != NULL);
- }
-
- // A file that exists in GData but not in cache.
- num_callback_invocations_ = 0;
- TestGetFileFromCacheByPath(
- gdata_file_path, base::PLATFORM_FILE_ERROR_NOT_FOUND);
- EXPECT_EQ(1, num_callback_invocations_);
-
- // Store a file corresponding to resource and md5 of "gdata/File 1.txt" to
- // cache.
- num_callback_invocations_ = 0;
- TestStoreToCache(file->resource_id(), file->file_md5(),
- GetTestFilePath("root_feed.json"), base::PLATFORM_FILE_OK,
- GDataFile::CACHE_STATE_PRESENT,
- GDataRootDirectory::CACHE_TYPE_TMP);
- EXPECT_EQ(1, num_callback_invocations_);
-
- // Now the file should exist in cache.
- num_callback_invocations_ = 0;
- TestGetFileFromCacheByPath(gdata_file_path, base::PLATFORM_FILE_OK);
- EXPECT_EQ(1, num_callback_invocations_);
-
- // A file that doesn't exist in gdata.
- num_callback_invocations_ = 0;
- TestGetFileFromCacheByPath(
- FilePath(FILE_PATH_LITERAL("gdata/Nonexistent.txt")),
- base::PLATFORM_FILE_ERROR_NOT_FOUND);
- EXPECT_EQ(1, num_callback_invocations_);
-}
-
// Create a directory through the document service
TEST_F(GDataFileSystemTest, CreateDirectoryWithService) {
LoadRootFeedDocument("root_feed.json");
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.cc ('k') | chrome/browser/chromeos/gdata/mock_gdata_file_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698