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

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

Issue 66293005: drive: Add drive/trash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix RemoveEntry Created 7 years, 1 month 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 | « no previous file | chrome/browser/chromeos/drive/file_system_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b1c6a56acf443cc2a7bc469b3b7af7e252e1a1d1..6ff69243a5f32437cf42062f75cbf2571b2487f3 100644
--- a/chrome/browser/chromeos/drive/file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/file_system_unittest.cc
@@ -434,23 +434,17 @@ TEST_F(FileSystemTest, ReadDirectory_Root) {
ReadDirectorySync(base::FilePath::FromUTF8Unsafe("drive")));
// The root directory should be read correctly.
ASSERT_TRUE(entries);
- ASSERT_EQ(2U, entries->size());
-
- // The found two directories should be /drive/root and /drive/other.
- bool found_other = false;
- bool found_my_drive = false;
- for (size_t i = 0; i < entries->size(); ++i) {
- const base::FilePath title =
- base::FilePath::FromUTF8Unsafe((*entries)[i].title());
- if (title == base::FilePath(util::kDriveOtherDirName)) {
- found_other = true;
- } else if (title == base::FilePath(util::kDriveMyDriveRootDirName)) {
- found_my_drive = true;
- }
- }
-
- EXPECT_TRUE(found_other);
- EXPECT_TRUE(found_my_drive);
+ ASSERT_EQ(3U, entries->size());
+
+ // The found three directories should be /drive/root, /drive/other and
+ // /drive/trash.
+ std::set<base::FilePath> found;
+ for (size_t i = 0; i < entries->size(); ++i)
+ found.insert(base::FilePath::FromUTF8Unsafe((*entries)[i].title()));
+ EXPECT_EQ(3U, found.size());
+ EXPECT_EQ(1U, found.count(base::FilePath(util::kDriveMyDriveRootDirName)));
+ EXPECT_EQ(1U, found.count(base::FilePath(util::kDriveOtherDirName)));
+ EXPECT_EQ(1U, found.count(base::FilePath(util::kDriveTrashDirName)));
ASSERT_EQ(1u, mock_directory_observer_->changed_directories().size());
EXPECT_EQ(base::FilePath(FILE_PATH_LITERAL("drive")),
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_system_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698