Skip to content

Commit

Permalink
Support StreamCopyOrMoveImpl in sandbox.
Browse files Browse the repository at this point in the history
StreamCopyOrMoveImpl has some issue.
* Return infelicity error code.
* Don't notify to observer.
This issue is fixed in Issue 522543002 so we can support it in sandbox.

BUG=360088
TEST=content_unittests passed

Review URL: https://codereview.chromium.org/541363002

Cr-Commit-Position: refs/heads/master@{#293677}
  • Loading branch information
iseki authored and Commit bot committed Sep 8, 2014
1 parent c76ef73 commit 9d31d51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions content/browser/fileapi/file_system_operation_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcFileAndOverwrite) {
base::RunLoop().RunUntilIdle();
EXPECT_EQ(base::File::FILE_OK, status());
EXPECT_TRUE(FileExists("dest"));
EXPECT_EQ(2, quota_manager_proxy()->notify_storage_accessed_count());
EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count());
EXPECT_EQ(4, quota_manager_proxy()->notify_storage_accessed_count());
EXPECT_EQ(2, change_observer()->get_and_reset_modify_file_count());

EXPECT_TRUE(change_observer()->HasNoChange());
}
Expand All @@ -628,9 +628,10 @@ TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcFileAndNew) {
base::RunLoop().RunUntilIdle();
EXPECT_EQ(base::File::FILE_OK, status());
EXPECT_TRUE(FileExists("new"));
EXPECT_EQ(2, quota_manager_proxy()->notify_storage_accessed_count());
EXPECT_EQ(4, quota_manager_proxy()->notify_storage_accessed_count());

EXPECT_EQ(1, change_observer()->get_and_reset_create_file_from_count());
EXPECT_EQ(1, change_observer()->get_and_reset_create_file_count());
EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count());
EXPECT_TRUE(change_observer()->HasNoChange());
}

Expand Down Expand Up @@ -694,7 +695,8 @@ TEST_F(FileSystemOperationImplTest, TestCopySuccessSrcDirRecursive) {

EXPECT_EQ(2, change_observer()->get_and_reset_create_directory_count());
EXPECT_EQ(1, change_observer()->get_and_reset_remove_directory_count());
EXPECT_EQ(1, change_observer()->get_and_reset_create_file_from_count());
EXPECT_EQ(1, change_observer()->get_and_reset_create_file_count());
EXPECT_EQ(1, change_observer()->get_and_reset_modify_file_count());
EXPECT_TRUE(change_observer()->HasNoChange());
}

Expand Down
2 changes: 1 addition & 1 deletion storage/browser/fileapi/sandbox_file_system_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ bool SandboxFileSystemBackend::SupportsStreaming(

bool SandboxFileSystemBackend::HasInplaceCopyImplementation(
storage::FileSystemType type) const {
return true;
return false;
}

scoped_ptr<storage::FileStreamReader>
Expand Down

0 comments on commit 9d31d51

Please sign in to comment.