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

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

Issue 276313002: drive: Change FileCache::GetCacheEntry's return type to FileError (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 289f4234e31fa717fd7ea110f13fd72530fcaa0c..ce6307b3f74d7fc8b20b21130d3b2cc06e9ee9ba 100644
--- a/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system/copy_operation_unittest.cc
@@ -62,7 +62,6 @@ TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_RegularFile) {
EXPECT_EQ(1U, observer()->updated_local_ids().count(
GetLocalId(remote_dest_path)));
FileCacheEntry cache_entry;
- bool found = false;
base::PostTaskAndReplyWithResult(
blocking_task_runner(),
FROM_HERE,
@@ -70,9 +69,9 @@ TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_RegularFile) {
base::Unretained(cache()),
GetLocalId(remote_dest_path),
&cache_entry),
- google_apis::test_util::CreateCopyResultCallback(&found));
+ google_apis::test_util::CreateCopyResultCallback(&error));
test_util::RunBlockingPoolTask();
- EXPECT_TRUE(found);
+ EXPECT_EQ(FILE_ERROR_OK, error);
EXPECT_TRUE(cache_entry.is_present());
EXPECT_TRUE(cache_entry.is_dirty());
@@ -107,15 +106,14 @@ TEST_F(CopyOperationTest, TransferFileFromLocalToRemote_Overwrite) {
EXPECT_EQ(FILE_ERROR_OK, GetLocalResourceEntry(remote_dest_path, &entry));
EXPECT_EQ(1U, observer()->updated_local_ids().count(entry.local_id()));
FileCacheEntry cache_entry;
- bool found = false;
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(&found));
+ google_apis::test_util::CreateCopyResultCallback(&error));
test_util::RunBlockingPoolTask();
- EXPECT_TRUE(found);
+ EXPECT_EQ(FILE_ERROR_OK, error);
EXPECT_TRUE(cache_entry.is_present());
EXPECT_TRUE(cache_entry.is_dirty());
@@ -351,7 +349,6 @@ TEST_F(CopyOperationTest, CopyDirtyFile) {
EXPECT_TRUE(observer()->get_changed_paths().count(dest_path.DirName()));
// Copied cache file should be dirty.
- bool success = false;
FileCacheEntry cache_entry;
base::PostTaskAndReplyWithResult(
blocking_task_runner(),
@@ -360,9 +357,9 @@ TEST_F(CopyOperationTest, CopyDirtyFile) {
base::Unretained(cache()),
dest_entry.local_id(),
&cache_entry),
- google_apis::test_util::CreateCopyResultCallback(&success));
+ google_apis::test_util::CreateCopyResultCallback(&error));
test_util::RunBlockingPoolTask();
- EXPECT_TRUE(success);
+ EXPECT_EQ(FILE_ERROR_OK, error);
EXPECT_TRUE(cache_entry.is_dirty());
// File contents should match.

Powered by Google App Engine
This is Rietveld 408576698