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

Unified Diff: chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc

Issue 285323002: drive: Remove FileCache::GetCacheEntry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/drive/file_system/copy_operation_unittest.cc
diff --git a/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc b/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc
index ce6307b3f74d7fc8b20b21130d3b2cc06e9ee9ba..7722301d09f92d536b4595a5151ff6432b30d6e6 100644
--- a/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc
@@ -59,21 +59,9 @@ TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_RegularFile) {
// TransferFileFromLocalToRemote stores a copy of the local file in the cache,
// marks it dirty and requests the observer to upload the file.
EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(remote_dest_path, &entry));
- EXPECT_EQ(1U, observer()->updated_local_ids().count(
- GetLocalId(remote_dest_path)));
- FileCacheEntry cache_entry;
- base::PostTaskAndReplyWithResult(
- blocking_task_runner(),
- FROM_HERE,
- base::Bind(&internal::FileCache::GetCacheEntry,
- base::Unretained(cache()),
- GetLocalId(remote_dest_path),
- &cache_entry),
- google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
- EXPECT_EQ(FILE_ERROR_OK, error);
- EXPECT_TRUE(cache_entry.is_present());
- EXPECT_TRUE(cache_entry.is_dirty());
+ EXPECT_EQ(1U, observer()->updated_local_ids().count(entry.local_id()));
+ EXPECT_TRUE(entry.file_specific_info().cache_state().is_present());
+ EXPECT_TRUE(entry.file_specific_info().cache_state().is_dirty());
EXPECT_EQ(1U, observer()->get_changed_paths().size());
EXPECT_TRUE(observer()->get_changed_paths().count(
@@ -105,17 +93,8 @@ TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_Overwrite) {
// marks it dirty and requests the observer to upload the file.
EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(remote_dest_path, &entry));
EXPECT_EQ(1U, observer()->updated_local_ids().count(entry.local_id()));
- FileCacheEntry cache_entry;
- base::PostTaskAndReplyWithResult(
- blocking_task_runner(),
- FROM_HERE,
- base::Bind(&internal::FileCache::GetCacheEntry,
- base::Unretained(cache()), entry.local_id(), &cache_entry),
- google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
- EXPECT_EQ(FILE_ERROR_OK, error);
- EXPECT_TRUE(cache_entry.is_present());
- EXPECT_TRUE(cache_entry.is_dirty());
+ EXPECT_TRUE(entry.file_specific_info().cache_state().is_present());
+ EXPECT_TRUE(entry.file_specific_info().cache_state().is_dirty());
EXPECT_EQ(1U, observer()->get_changed_paths().size());
EXPECT_TRUE(observer()->get_changed_paths().count(
@@ -349,18 +328,7 @@ TEST_F(CopyOperationTest, CopyDirtyFile) {
EXPECT_TRUE(observer()->get_changed_paths().count(dest_path.DirName()));
// Copied cache file should be dirty.
- FileCacheEntry cache_entry;
- base::PostTaskAndReplyWithResult(
- blocking_task_runner(),
- FROM_HERE,
- base::Bind(&internal::FileCache::GetCacheEntry,
- base::Unretained(cache()),
- dest_entry.local_id(),
- &cache_entry),
- google_apis::test_util::CreateCopyResultCallback(&error));
- test_util::RunBlockingPoolTask();
- EXPECT_EQ(FILE_ERROR_OK, error);
- EXPECT_TRUE(cache_entry.is_dirty());
+ EXPECT_TRUE(dest_entry.file_specific_info().cache_state().is_dirty());
// File contents should match.
base::FilePath cache_file_path;

Powered by Google App Engine
This is Rietveld 408576698