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

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

Issue 10861015: gdata: Add GDataDirectoryService::GetEntryInfoByResourceId() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 4 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_directory_service.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/gdata/gdata_directory_service_unittest.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_directory_service_unittest.cc b/chrome/browser/chromeos/gdata/gdata_directory_service_unittest.cc
index daa64fa693960dbfaf83b2efe03c8a446b09c461..f5a39682af4a70ca7b352a5053cc9d42bd85276f 100644
--- a/chrome/browser/chromeos/gdata/gdata_directory_service_unittest.cc
+++ b/chrome/browser/chromeos/gdata/gdata_directory_service_unittest.cc
@@ -315,6 +315,37 @@ TEST(GDataDirectoryServiceTest, GetEntryByResourceId_RootDirectory) {
EXPECT_EQ(kGDataRootDirectoryResourceId, entry->resource_id());
}
+TEST(GDataDirectoryServiceTest, GetEntryInfoByResourceId) {
+ MessageLoopForUI message_loop;
+ content::TestBrowserThread ui_thread(content::BrowserThread::UI,
+ &message_loop);
+ GDataDirectoryService directory_service;
+ InitDirectoryService(&directory_service);
+
+ // Confirm that an existing file is found.
+ GDataFileError error = GDATA_FILE_ERROR_FAILED;
+ scoped_ptr<GDataEntryProto> entry_proto;
+ directory_service.GetEntryInfoByResourceId(
+ "file_resource_id:file4",
+ base::Bind(&test_util::CopyResultsFromGetEntryInfoCallback,
+ &error, &entry_proto));
+ test_util::RunBlockingPoolTask();
+ EXPECT_EQ(GDATA_FILE_OK, error);
+ ASSERT_TRUE(entry_proto.get());
+ EXPECT_EQ("file4", entry_proto->base_name());
+
+ // Confirm that a non existing file is not found.
+ error = GDATA_FILE_ERROR_FAILED;
+ entry_proto.reset();
+ directory_service.GetEntryInfoByResourceId(
+ "file:non_existing",
+ base::Bind(&test_util::CopyResultsFromGetEntryInfoCallback,
+ &error, &entry_proto));
+ test_util::RunBlockingPoolTask();
+ EXPECT_EQ(GDATA_FILE_ERROR_NOT_FOUND, error);
+ EXPECT_FALSE(entry_proto.get());
+}
+
TEST(GDataDirectoryServiceTest, GetEntryInfoByPath) {
MessageLoopForUI message_loop;
content::TestBrowserThread ui_thread(content::BrowserThread::UI,
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_directory_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698