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

Unified Diff: chrome/browser/chromeos/drive/drive_resource_metadata_unittest.cc

Issue 14108009: chromeos: Use WriteBatch to update DriveResourceMetadata DB (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename method Created 7 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
« no previous file with comments | « chrome/browser/chromeos/drive/drive_resource_metadata_storage_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/drive/drive_resource_metadata_unittest.cc
diff --git a/chrome/browser/chromeos/drive/drive_resource_metadata_unittest.cc b/chrome/browser/chromeos/drive/drive_resource_metadata_unittest.cc
index effc411b63d5538b3e768ddb05e9c92cb94c9392..a5b82dc8a32889fac7e9b9fcf7a085d05824bf84 100644
--- a/chrome/browser/chromeos/drive/drive_resource_metadata_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_resource_metadata_unittest.cc
@@ -709,11 +709,27 @@ TEST_F(DriveResourceMetadataTest, RefreshEntry) {
ASSERT_TRUE(!entry_proto->file_info().is_directory());
EXPECT_EQ("md5:file9", entry_proto->file_specific_info().file_md5());
- // Rename it and change the file size.
+ // Rename it.
DriveEntryProto file_entry_proto(*entry_proto);
+ file_entry_proto.set_title("file100");
+ entry_proto.reset();
+ resource_metadata_->RefreshEntry(
+ file_entry_proto,
+ google_apis::test_util::CreateCopyResultCallback(
+ &error, &drive_file_path, &entry_proto));
+ google_apis::test_util::RunBlockingPoolTask();
+ EXPECT_EQ(FILE_ERROR_OK, error);
+ EXPECT_EQ(base::FilePath::FromUTF8Unsafe("drive/root/dir1/dir3/file100"),
+ drive_file_path);
+ ASSERT_TRUE(entry_proto.get());
+ EXPECT_EQ("file100", entry_proto->base_name());
+ ASSERT_TRUE(!entry_proto->file_info().is_directory());
+ EXPECT_EQ("md5:file9", entry_proto->file_specific_info().file_md5());
+
+ // Update the file md5.
const std::string updated_md5("md5:updated");
+ file_entry_proto = *entry_proto;
file_entry_proto.mutable_file_specific_info()->set_file_md5(updated_md5);
- file_entry_proto.set_title("file100");
entry_proto.reset();
resource_metadata_->RefreshEntry(
file_entry_proto,
« no previous file with comments | « chrome/browser/chromeos/drive/drive_resource_metadata_storage_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698