Index: chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc |
=================================================================== |
--- chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc (revision 124690) |
+++ chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc (working copy) |
@@ -1,6 +1,7 @@ |
// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+ |
#include <string> |
#include <vector> |
@@ -366,7 +367,6 @@ |
EXPECT_FALSE(RemoveFile(FilePath("gdata"))); |
} |
- |
TEST_F(GDataFileSystemTest, CreateDirectory) { |
LoadRootFeedDocument("root_feed.json"); |
LoadSubdirFeedDocument(FilePath("gdata/Directory 1"), "subdir_feed.json"); |
@@ -394,48 +394,50 @@ |
// Create directory in root. |
FilePath dir_path("gdata/New Folder 1"); |
EXPECT_EQ( |
+ GDataFileSystem::FOUND_MISSING, |
file_system_->FindFirstMissingParentDirectory(dir_path, |
&last_dir_content_url, |
- &first_missing_parent_path), |
- GDataFileSystem::FOUND_MISSING); |
- EXPECT_EQ(dir_path, first_missing_parent_path); |
+ &first_missing_parent_path)); |
+ EXPECT_EQ(FilePath("gdata/New Folder 1"), first_missing_parent_path); |
satorux1
2012/03/02 21:31:24
nit: FilePath(FILE_PATH_LITERAL(...)) or FilePath:
zel
2012/03/02 21:46:44
Fixed there and on bunch of other places in this f
|
EXPECT_TRUE(last_dir_content_url.is_empty()); // root directory. |
// Missing folders in subdir of an existing folder. |
FilePath dir_path2("gdata/Directory 1/New Folder 2"); |
EXPECT_EQ( |
+ GDataFileSystem::FOUND_MISSING, |
file_system_->FindFirstMissingParentDirectory(dir_path2, |
&last_dir_content_url, |
- &first_missing_parent_path), |
- GDataFileSystem::FOUND_MISSING); |
- EXPECT_EQ(dir_path2, first_missing_parent_path); |
+ &first_missing_parent_path)); |
+ EXPECT_EQ(FilePath("gdata/Directory 1/New Folder 2"), |
+ first_missing_parent_path); |
EXPECT_FALSE(last_dir_content_url.is_empty()); // non-root directory. |
// Missing two folders on the path. |
FilePath dir_path3 = dir_path2.Append("Another Foder"); |
EXPECT_EQ( |
+ GDataFileSystem::FOUND_MISSING, |
file_system_->FindFirstMissingParentDirectory(dir_path3, |
&last_dir_content_url, |
- &first_missing_parent_path), |
- GDataFileSystem::FOUND_MISSING); |
- EXPECT_EQ(dir_path3.DirName(), first_missing_parent_path); |
+ &first_missing_parent_path)); |
+ EXPECT_EQ(FilePath("gdata/Directory 1/New Folder 2"), |
+ first_missing_parent_path); |
EXPECT_FALSE(last_dir_content_url.is_empty()); // non-root directory. |
// Folders on top of an existing file. |
EXPECT_EQ( |
+ GDataFileSystem::FOUND_INVALID, |
file_system_->FindFirstMissingParentDirectory( |
FilePath("gdata/File 1.txt/BadDir"), |
&last_dir_content_url, |
- &first_missing_parent_path), |
- GDataFileSystem::FOUND_INVALID); |
+ &first_missing_parent_path)); |
// Existing folder. |
EXPECT_EQ( |
+ GDataFileSystem::DIRECTORY_ALREADY_PRESENT, |
file_system_->FindFirstMissingParentDirectory( |
FilePath("gdata/Directory 1"), |
&last_dir_content_url, |
- &first_missing_parent_path), |
- GDataFileSystem::DIRECTORY_ALREADY_PRESENT); |
+ &first_missing_parent_path)); |
} |
} // namespace gdata |