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

Unified Diff: webkit/fileapi/syncable/local_file_sync_context_unittest.cc

Issue 14623008: [SyncFileSystem] Remove existing entry on LocalFileSyncContext::ApplyRemoteChange call. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment 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 | « webkit/fileapi/syncable/local_file_sync_context.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/syncable/local_file_sync_context_unittest.cc
diff --git a/webkit/fileapi/syncable/local_file_sync_context_unittest.cc b/webkit/fileapi/syncable/local_file_sync_context_unittest.cc
index dc955a0d5a9240ba5ee49e94db0169c3b3907b69..5f5b820f8438b23bf9e888b9276ab657ddab48aa 100644
--- a/webkit/fileapi/syncable/local_file_sync_context_unittest.cc
+++ b/webkit/fileapi/syncable/local_file_sync_context_unittest.cc
@@ -576,14 +576,26 @@ TEST_F(LocalFileSyncContextTest, ApplyRemoteChangeForAddOrUpdate) {
change, base::FilePath(), kDir,
SYNC_FILE_TYPE_UNKNOWN));
- // This should not happen, but calling ApplyRemoteChange
- // with wrong file type will result in error.
- change = FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE,
- SYNC_FILE_TYPE_FILE);
- EXPECT_NE(SYNC_STATUS_OK,
+ // Calling ApplyRemoteChange with different file type should be handled as
+ // overwrite.
+ change =
+ FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE, SYNC_FILE_TYPE_FILE);
+ EXPECT_EQ(SYNC_STATUS_OK,
ApplyRemoteChange(file_system.file_system_context(),
- change, kFilePath1, kDir,
+ change,
+ kFilePath1,
+ kDir,
SYNC_FILE_TYPE_DIRECTORY));
+ EXPECT_EQ(base::PLATFORM_FILE_OK, file_system.FileExists(kDir));
+
+ change = FileChange(FileChange::FILE_CHANGE_ADD_OR_UPDATE,
+ SYNC_FILE_TYPE_DIRECTORY);
+ EXPECT_EQ(SYNC_STATUS_OK,
+ ApplyRemoteChange(file_system.file_system_context(),
+ change,
+ kFilePath1,
+ kDir,
+ SYNC_FILE_TYPE_FILE));
// Creating a file/directory must have increased the usage more than
// the size of kTestFileData2.
« no previous file with comments | « webkit/fileapi/syncable/local_file_sync_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698