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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc

Issue 9836086: Added logic that will return the result of the first chunk of root feed and continue fetching the r… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed asserts in browser_tests Created 8 years, 9 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/gdata/gdata_file_system.cc ('k') | chrome/browser/chromeos/gdata/gdata_files.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc b/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
index 5267ca4abab391a6dbdeebb680b74642b912f43e..7651e69aad5f1391eb5e26b6c7d4e0adf2db73ef 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system_unittest.cc
@@ -190,6 +190,14 @@ class GDataFileSystemTest : public testing::Test {
return search_delegate.file();
}
+ GDataFileBase* FindFileElementByResourceId(const std::string& resource_id) {
+ ReadOnlyFindFileDelegate search_delegate;
+ file_system_->FindFileByPathSync(FilePath(FILE_PATH_LITERAL("gdata")),
+ &search_delegate);
+ return search_delegate.file()->AsGDataRootDirectory()->GetFileByResourceId(
+ resource_id);
+ }
+
void FindAndTestFilePath(const FilePath& file_path) {
GDataFileBase* file = FindFile(file_path);
ASSERT_TRUE(file) << "File can't be found " << file_path.value();
@@ -929,6 +937,14 @@ TEST_F(GDataFileSystemTest, CachedFeedLoading) {
FindAndTestFilePath(
FilePath(FILE_PATH_LITERAL(
"gdata/Directory 1/Sub Directory Folder/Feed 2 Directory")));
+
+ // Make sure orphaned files didn't make into the file system.
+ ASSERT_FALSE(FindFileElementByResourceId(
+ "file:orphan_file_resource_id"));
+ ASSERT_FALSE(FindFileElementByResourceId(
+ "folder:orphan_feed_folder_resouce_id"));
+ ASSERT_FALSE(FindFileElementByResourceId(
+ "file:orphan_subfolder_file_resource_id"));
}
TEST_F(GDataFileSystemTest, CopyNotExistingFile) {
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.cc ('k') | chrome/browser/chromeos/gdata/gdata_files.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698