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

Unified Diff: chrome/browser/chromeos/drive/file_system_unittest.cc

Issue 19596003: Remove CloseFile from FileSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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: 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..a5a79229fce540316b60b188f740a48df760aafd 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 close_callback;
file_system_->OpenFile(
kFileInRoot,
OPEN_FILE,
- google_apis::test_util::CreateCopyResultCallback(&error, &file_path));
+ google_apis::test_util::CreateCopyResultCallback(
+ &error, &file_path, &close_callback));
test_util::RunBlockingPoolTask();
const base::FilePath opened_file_path = file_path;
@@ -780,9 +782,8 @@ TEST_F(FileSystemTest, OpenAndCloseFile) {
kNewContent));
// Close kFileInRoot ("drive/root/File 1.txt").
- file_system_->CloseFile(
- kFileInRoot,
- google_apis::test_util::CreateCopyResultCallback(&error));
+ ASSERT_FALSE(close_callback.is_null());
+ close_callback.Run();
test_util::RunBlockingPoolTask();
// Verify that the file was properly closed.
@@ -805,17 +806,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) {
« no previous file with comments | « chrome/browser/chromeos/drive/file_system_interface.h ('k') | chrome/browser/chromeos/drive/file_write_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698