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

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

Issue 13579005: chromeos: Fix FilePath handling incompatibility between FakeDriveFileSystem::GetEntryInfoByResource… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 7 years, 8 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/drive/fake_drive_file_system.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/drive/fake_drive_file_system_unittest.cc
diff --git a/chrome/browser/chromeos/drive/fake_drive_file_system_unittest.cc b/chrome/browser/chromeos/drive/fake_drive_file_system_unittest.cc
index 67b8dbb0cf87ba3575b68e47c09f936213416da9..40dba8826f4ef92f2e6a8ae79e741f8c10d2f47a 100644
--- a/chrome/browser/chromeos/drive/fake_drive_file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/fake_drive_file_system_unittest.cc
@@ -63,6 +63,38 @@ TEST_F(FakeDriveFileSystemTest, GetEntryInfoByResourceId) {
EXPECT_TRUE(entry); // Just make sure something is returned.
}
+TEST_F(FakeDriveFileSystemTest,
+ GetEntryInfoByResourceId_PathCompatibleWithGetEntryInfoByPath) {
+ const std::string document_resource_id = "document:5_document_resource_id";
+
+ DriveFileError error = DRIVE_FILE_ERROR_FAILED;
+ scoped_ptr<DriveEntryProto> entry;
+ base::FilePath file_path;
+
+ // Get entry info by resource id.
+ fake_drive_file_system_->GetEntryInfoByResourceId(
+ document_resource_id,
+ google_apis::test_util::CreateCopyResultCallback(
+ &error, &file_path, &entry));
+ google_apis::test_util::RunBlockingPoolTask();
+
+ ASSERT_EQ(DRIVE_FILE_OK, error);
+ ASSERT_TRUE(entry);
+ EXPECT_TRUE(entry->file_specific_info().is_hosted_document());
+
+ // Get entry info by path given by GetEntryInfoByResourceId.
+ error = DRIVE_FILE_ERROR_FAILED;
+ entry.reset();
+ fake_drive_file_system_->GetEntryInfoByPath(
+ file_path,
+ google_apis::test_util::CreateCopyResultCallback(&error, &entry));
+ google_apis::test_util::RunBlockingPoolTask();
+
+ ASSERT_EQ(DRIVE_FILE_OK, error);
+ ASSERT_TRUE(entry);
+ EXPECT_EQ(document_resource_id, entry->resource_id());
+}
+
TEST_F(FakeDriveFileSystemTest, GetEntryInfoByPath) {
DriveFileError error = DRIVE_FILE_ERROR_FAILED;
scoped_ptr<DriveEntryProto> entry;
« no previous file with comments | « chrome/browser/chromeos/drive/fake_drive_file_system.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698