Chromium Code Reviews| 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..a50de792b01bb6dbf05188c27702f27bd890dcb2 100644 |
| --- a/webkit/fileapi/syncable/local_file_sync_context_unittest.cc |
| +++ b/webkit/fileapi/syncable/local_file_sync_context_unittest.cc |
| @@ -576,14 +576,24 @@ 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)); |
|
kinuko
2013/04/30 13:31:09
Can we check FileExists(kDir) here?
tzik
2013/04/30 13:54:40
Done.
|
| + 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. |