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

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

Issue 119823002: drive: Show files shared to me from other account's shared folder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix Created 7 years 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/change_list_processor_unittest.cc
diff --git a/chrome/browser/chromeos/drive/change_list_processor_unittest.cc b/chrome/browser/chromeos/drive/change_list_processor_unittest.cc
index 111c5ee74bb75e6656c8926d34475d0d6f8eaf61..ae4e0340913211e092823b32d7d3dedc613b48f2 100644
--- a/chrome/browser/chromeos/drive/change_list_processor_unittest.cc
+++ b/chrome/browser/chromeos/drive/change_list_processor_unittest.cc
@@ -582,5 +582,31 @@ TEST_F(ChangeListProcessorTest, RefreshDirectory_WrongParentId) {
util::GetDriveMyDriveRootPath().AppendASCII(new_file.title()), &entry));
}
+TEST_F(ChangeListProcessorTest, SharedFilesWithNoParentInFeed) {
+ // Prepare metadata.
+ EXPECT_EQ(FILE_ERROR_OK,
+ ApplyFullResourceList(ParseChangeList(kBaseResourceListFile)));
+
+ // Create change lists.
+ ScopedVector<ChangeList> change_lists;
+ change_lists.push_back(new ChangeList);
+
+ // Add a new file with non-existing parent resource id to the change lists.
+ ResourceEntry new_file;
+ new_file.set_title("new_file");
+ new_file.set_resource_id("new_file_id");
+ change_lists[0]->mutable_entries()->push_back(new_file);
+ change_lists[0]->mutable_parent_resource_ids()->push_back("nonexisting");
+ change_lists[0]->set_largest_changestamp(kBaseResourceListChangestamp + 1);
+
+ std::set<base::FilePath> changed_dirs;
+ EXPECT_EQ(FILE_ERROR_OK, ApplyChangeList(change_lists.Pass(), &changed_dirs));
+
+ // "new_file" should be added under drive/other.
+ ResourceEntry entry;
+ EXPECT_EQ(FILE_ERROR_OK, metadata_->GetResourceEntryByPath(
+ util::GetDriveGrandRootPath().AppendASCII("other/new_file"), &entry));
+}
+
} // namespace internal
} // namespace drive

Powered by Google App Engine
This is Rietveld 408576698