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

Unified Diff: content/browser/fileapi/file_system_operation_impl_unittest.cc

Issue 536453007: Add truncation to StreamCopyOrMoveImpl and test case. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: content/browser/fileapi/file_system_operation_impl_unittest.cc
diff --git a/content/browser/fileapi/file_system_operation_impl_unittest.cc b/content/browser/fileapi/file_system_operation_impl_unittest.cc
index afbe664aaf2b3233a9ded3ebfd43aab94a848997..b6a1c46177a1981f9cff6979571d6bb6354f59e7 100644
--- a/content/browser/fileapi/file_system_operation_impl_unittest.cc
+++ b/content/browser/fileapi/file_system_operation_impl_unittest.cc
@@ -1287,4 +1287,21 @@ TEST_F(FileSystemOperationImplTest,
EXPECT_EQ(expected_usage, usage);
}
+TEST_F(FileSystemOperationImplTest,
+ TestCopySuccessSrcFileWithDifferentFileSize) {
+ FileSystemURL src_file(CreateFile("src"));
+ FileSystemURL dest_file(CreateFile("dest"));
+ operation_runner()->Truncate(dest_file, 6, RecordStatusCallback());
+ base::RunLoop().RunUntilIdle();
+
+ operation_runner()->Copy(src_file,
+ dest_file,
+ FileSystemOperation::OPTION_NONE,
+ FileSystemOperationRunner::CopyProgressCallback(),
+ RecordStatusCallback());
+ base::RunLoop().RunUntilIdle();
tzik 2014/09/03 02:07:43 This doesn't run the modified part of the code unt
iseki 2014/09/03 03:28:21 Done.
+ EXPECT_EQ(0, GetFileSize("dest"));
+ EXPECT_EQ(base::File::FILE_OK, status());
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698