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

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

Issue 942633004: IndexedDB: Fixed support for empty blobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deleted CREATE_NEW_FILE. Creating file before using FileStreamWriter. Created 5 years, 10 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/copy_or_move_operation_delegate_unittest.cc
diff --git a/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc b/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
index 451353d1cd91e7bfe12797da0cef158340157a96..4834f482f5a1f25ed137778c20a8849349d0c561 100644
--- a/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
+++ b/content/browser/fileapi/copy_or_move_operation_delegate_unittest.cc
@@ -735,8 +735,13 @@ TEST(LocalFileSystemCopyOrMoveOperationTest, StreamCopyHelper) {
storage::FileStreamReader::CreateForLocalFile(
task_runner.get(), source_path, 0, base::Time()));
- scoped_ptr<FileStreamWriter> writer(FileStreamWriter::CreateForLocalFile(
- task_runner.get(), dest_path, 0, FileStreamWriter::CREATE_NEW_FILE));
+ {
+ base::File file(dest_path,
+ base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
+ EXPECT_TRUE(file.created());
michaeln 2015/03/03 00:02:51 Ah, so there were some uses of the CREATE_NEW_FILE
cmumford 2015/03/03 22:26:09 Done.
+ }
+ scoped_ptr<FileStreamWriter> writer(
+ FileStreamWriter::CreateForLocalFile(task_runner.get(), dest_path, 0));
std::vector<int64> progress;
CopyOrMoveOperationDelegate::StreamCopyHelper helper(
@@ -791,8 +796,13 @@ TEST(LocalFileSystemCopyOrMoveOperationTest, StreamCopyHelperWithFlush) {
storage::FileStreamReader::CreateForLocalFile(
task_runner.get(), source_path, 0, base::Time()));
- scoped_ptr<FileStreamWriter> writer(FileStreamWriter::CreateForLocalFile(
- task_runner.get(), dest_path, 0, FileStreamWriter::CREATE_NEW_FILE));
+ {
+ base::File file(dest_path,
+ base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
+ EXPECT_TRUE(file.created());
+ }
+ scoped_ptr<FileStreamWriter> writer(
+ FileStreamWriter::CreateForLocalFile(task_runner.get(), dest_path, 0));
std::vector<int64> progress;
CopyOrMoveOperationDelegate::StreamCopyHelper helper(
@@ -842,8 +852,13 @@ TEST(LocalFileSystemCopyOrMoveOperationTest, StreamCopyHelper_Cancel) {
storage::FileStreamReader::CreateForLocalFile(
task_runner.get(), source_path, 0, base::Time()));
- scoped_ptr<FileStreamWriter> writer(FileStreamWriter::CreateForLocalFile(
- task_runner.get(), dest_path, 0, FileStreamWriter::CREATE_NEW_FILE));
+ {
+ base::File file(dest_path,
+ base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
+ EXPECT_TRUE(file.created());
+ }
+ scoped_ptr<FileStreamWriter> writer(
+ FileStreamWriter::CreateForLocalFile(task_runner.get(), dest_path, 0));
std::vector<int64> progress;
CopyOrMoveOperationDelegate::StreamCopyHelper helper(

Powered by Google App Engine
This is Rietveld 408576698