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

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

Issue 14067009: drive: Call LoadIfNeeded before CreateDirectory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 8 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
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_file_system_unittest.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
index c3911c459dec7c901496aa1a4a87c3abd9a436cf..e2811d1bec3c24e0fddddb4c7593e3205f13fcc9 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
@@ -1485,6 +1485,24 @@ TEST_F(DriveFileSystemTest, CreateDirectory) {
EXPECT_TRUE(EntryExists(subdir_path));
}
+TEST_F(DriveFileSystemTest, CreateDirectoryByImplicitLoad) {
+ // Intentionally *not* calling LoadRootFeedDocument(), for testing that
+ // CreateDirectory ensures feed loading before it runs.
+
+ base::FilePath existing_directory(
+ FILE_PATH_LITERAL("drive/root/Directory 1"));
+ FileError error = FILE_ERROR_FAILED;
+ file_system_->CreateDirectory(
+ existing_directory,
+ true, // is_exclusive
+ false, // is_recursive
+ google_apis::test_util::CreateCopyResultCallback(&error));
+ google_apis::test_util::RunBlockingPoolTask();
+
+ // It should fail because is_exclusive is set to true.
+ EXPECT_EQ(FILE_ERROR_EXISTS, error);
+}
+
TEST_F(DriveFileSystemTest, PinAndUnpin) {
ASSERT_TRUE(LoadRootFeedDocument());
« no previous file with comments | « chrome/browser/chromeos/drive/drive_file_system.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698