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

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

Issue 304183005: drive: Always use last_modified stored in ResourceEntry (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
« no previous file with comments | « chrome/browser/chromeos/drive/file_cache.cc ('k') | chrome/browser/chromeos/drive/file_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/file_cache_unittest.cc
diff --git a/chrome/browser/chromeos/drive/file_cache_unittest.cc b/chrome/browser/chromeos/drive/file_cache_unittest.cc
index bbb9b883df895272d27f191cecb6a6485bcbe690..cb98fa7d01ba91cb2b539c67df90f03114ff4a99 100644
--- a/chrome/browser/chromeos/drive/file_cache_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_cache_unittest.cc
@@ -358,6 +358,7 @@ TEST_F(FileCacheTest, OpenForWrite) {
EXPECT_EQ(FILE_ERROR_OK, metadata_storage_->PutEntry(entry));
ASSERT_EQ(FILE_ERROR_OK, cache_->Store(id, "md5", src_file,
FileCache::FILE_OPERATION_COPY));
+ EXPECT_EQ(0, entry.file_info().last_modified());
// Entry is not dirty nor opened.
EXPECT_FALSE(cache_->IsOpenedForWrite(id));
@@ -382,6 +383,10 @@ TEST_F(FileCacheTest, OpenForWrite) {
file_closer1.reset();
EXPECT_TRUE(cache_->IsOpenedForWrite(id));
+ // last_modified is updated.
+ EXPECT_EQ(FILE_ERROR_OK, metadata_storage_->GetEntry(id, &entry));
+ EXPECT_NE(0, entry.file_info().last_modified());
+
// Close (2).
file_closer2.reset();
EXPECT_FALSE(cache_->IsOpenedForWrite(id));
« no previous file with comments | « chrome/browser/chromeos/drive/file_cache.cc ('k') | chrome/browser/chromeos/drive/file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698