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

Unified Diff: chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc

Issue 372843007: [SyncFS] Implement getters and counters of FileMetadata and FileTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build error Created 6 years, 5 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/sync_file_system/drive_backend/metadata_database_index_on_disk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc
index 70c0968d51919e4aeee520b1f4568db309f9f479..560edd2a0ce80c42f5292be132d410a5ec01d6aa 100644
--- a/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk_unittest.cc
@@ -183,6 +183,27 @@ TEST_F(MetadataDatabaseIndexOnDiskTest, SetEntryTest) {
EXPECT_FALSE(index()->GetFileTracker(tracker_id, NULL));
}
+TEST_F(MetadataDatabaseIndexOnDiskTest, AllEntriesTest) {
+ CreateTestDatabase(true);
+
+ EXPECT_EQ(3U, index()->CountFileMetadata());
+ std::vector<std::string> file_ids(index()->GetAllMetadataIDs());
+ ASSERT_EQ(3U, file_ids.size());
+ std::sort(file_ids.begin(), file_ids.end());
+ EXPECT_EQ("app_root_folder_id", file_ids[0]);
+ EXPECT_EQ("file_id", file_ids[1]);
+ EXPECT_EQ("sync_root_folder_id", file_ids[2]);
+
+ EXPECT_EQ(4U, index()->CountFileTracker());
+ std::vector<int64> tracker_ids = index()->GetAllTrackerIDs();
+ ASSERT_EQ(4U, tracker_ids.size());
+ std::sort(tracker_ids.begin(), tracker_ids.end());
+ EXPECT_EQ(kSyncRootTrackerID, tracker_ids[0]);
+ EXPECT_EQ(kAppRootTrackerID, tracker_ids[1]);
+ EXPECT_EQ(kFileTrackerID, tracker_ids[2]);
+ EXPECT_EQ(kPlaceholderTrackerID, tracker_ids[3]);
+}
+
TEST_F(MetadataDatabaseIndexOnDiskTest, IndexAppRootIDByAppIDTest) {
CreateTestDatabase(true);
« no previous file with comments | « chrome/browser/sync_file_system/drive_backend/metadata_database_index_on_disk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698