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

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

Issue 11227020: Set root resource ID upon full feed update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert the previous Created 8 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
Index: chrome/browser/chromeos/drive/drive_file_system_unittest.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
index 8f2a42000685b6c10f9364f3438f38389728145b..9ca023d1ca16d44dd1693cabc412cdfc66110def 100644
--- a/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system_unittest.cc
@@ -49,6 +49,10 @@ using ::testing::_;
namespace drive {
namespace {
+// The root directory resource ID for WAPI.
+// TODO(haruki): Make Drive API equivalent work. http://crbug.com/157114
+const char kTestRootDirectoryResourceId[] = "folder:testroot";
+
const char kSymLinkToDevNull[] = "/dev/null";
const int64 kLotsOfSpace = kMinFreeSpace * 10;
@@ -627,7 +631,7 @@ class DriveFileSystemTest : public testing::Test {
DriveEntryProto* dir_base = root_dir->mutable_drive_entry();
PlatformFileInfoProto* platform_info = dir_base->mutable_file_info();
dir_base->set_title("drive");
- dir_base->set_resource_id(kDriveRootDirectoryResourceId);
+ dir_base->set_resource_id(kTestRootDirectoryResourceId);
dir_base->set_upload_url("http://resumable-create-media/1");
platform_info->set_is_directory(true);
@@ -875,7 +879,9 @@ TEST_F(DriveFileSystemTest, SearchRootDirectory) {
scoped_ptr<DriveEntryProto> entry = GetEntryInfoByPathSync(
FilePath(FILE_PATH_LITERAL(kFilePath)));
ASSERT_TRUE(entry.get());
- EXPECT_EQ(kDriveRootDirectoryResourceId, entry->resource_id());
+ // We get kWAPIRootDirectoryResourceId instead of kTestRootDirectoryResourceId
+ // here, as the root ID is set in DriveFeedLoader::UpdateFromFeed().
+ EXPECT_EQ(kWAPIRootDirectoryResourceId, entry->resource_id());
}
TEST_F(DriveFileSystemTest, SearchExistingFile) {
@@ -2577,8 +2583,10 @@ TEST_F(DriveFileSystemTest, RequestDirectoryRefresh) {
LoadRootFeedDocument("gdata/root_feed.json");
// We'll fetch documents in the root directory with its resource ID.
+ // kWAPIRootDirectoryResourceId instead of kTestRootDirectoryResourceId
+ // is used here as the root ID is set in DriveFeedLoader::UpdateFromFeed().
EXPECT_CALL(*mock_drive_service_,
- GetDocuments(Eq(GURL()), _, _, kDriveRootDirectoryResourceId, _))
+ GetDocuments(Eq(GURL()), _, _, kWAPIRootDirectoryResourceId, _))
.Times(1);
// We'll notify the directory change to the observer.
EXPECT_CALL(*mock_directory_observer_,
« no previous file with comments | « chrome/browser/chromeos/drive/drive_feed_loader.cc ('k') | chrome/browser/chromeos/drive/drive_resource_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698