Chromium Code Reviews| Index: chrome/browser/chromeos/drive/file_system_unittest.cc |
| diff --git a/chrome/browser/chromeos/drive/file_system_unittest.cc b/chrome/browser/chromeos/drive/file_system_unittest.cc |
| index 9a043c7744e0cd97ae0fa5e0952bf0e5a0dc62f2..d58149ac34df5be9442db8bc8594b9aff41dc802 100644 |
| --- a/chrome/browser/chromeos/drive/file_system_unittest.cc |
| +++ b/chrome/browser/chromeos/drive/file_system_unittest.cc |
| @@ -741,10 +741,12 @@ TEST_F(FileSystemTest, OpenAndCloseFile) { |
| // Open kFileInRoot ("drive/root/File 1.txt"). |
| FileError error = FILE_ERROR_FAILED; |
| base::FilePath file_path; |
| + base::Closure on_close_callback; |
| file_system_->OpenFile( |
| kFileInRoot, |
| OPEN_FILE, |
| - google_apis::test_util::CreateCopyResultCallback(&error, &file_path)); |
| + google_apis::test_util::CreateCopyResultCallback( |
| + &error, &file_path, &on_close_callback)); |
| test_util::RunBlockingPoolTask(); |
| const base::FilePath opened_file_path = file_path; |
| @@ -780,9 +782,7 @@ TEST_F(FileSystemTest, OpenAndCloseFile) { |
| kNewContent)); |
| // Close kFileInRoot ("drive/root/File 1.txt"). |
|
hashimoto
2013/07/23 11:24:58
nit: How about ASSERT_FALSE(on_close_callback.is_n
hidehiko
2013/07/23 14:32:24
Done.
|
| - file_system_->CloseFile( |
| - kFileInRoot, |
| - google_apis::test_util::CreateCopyResultCallback(&error)); |
| + on_close_callback.Run(); |
| test_util::RunBlockingPoolTask(); |
| // Verify that the file was properly closed. |
| @@ -805,17 +805,6 @@ TEST_F(FileSystemTest, OpenAndCloseFile) { |
| ASSERT_EQ(2u, mock_directory_observer_->changed_directories().size()); |
| EXPECT_EQ(base::FilePath(FILE_PATH_LITERAL("drive/root")), |
| mock_directory_observer_->changed_directories()[1]); |
| - |
| - // Try to close the same file twice. |
| - file_system_->CloseFile( |
| - kFileInRoot, |
| - google_apis::test_util::CreateCopyResultCallback(&error)); |
| - test_util::RunBlockingPoolTask(); |
| - |
| - // It must fail. |
| - EXPECT_EQ(FILE_ERROR_NOT_FOUND, error); |
| - // There should be no new directory change. |
| - ASSERT_EQ(2u, mock_directory_observer_->changed_directories().size()); |
| } |
| TEST_F(FileSystemTest, MarkCacheFileAsMountedAndUnmounted) { |