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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc

Issue 187203004: [SyncFS] Improve debug logs of MetadataDatabaseIndex (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/metadata_database.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <stack> 6 #include <stack>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 const std::string& folder_id, 338 const std::string& folder_id,
339 CannedSyncableFileSystem* file_system) { 339 CannedSyncableFileSystem* file_system) {
340 SCOPED_TRACE(testing::Message() << "Verifying folder: " << path.value()); 340 SCOPED_TRACE(testing::Message() << "Verifying folder: " << path.value());
341 341
342 ScopedVector<google_apis::ResourceEntry> remote_entries; 342 ScopedVector<google_apis::ResourceEntry> remote_entries;
343 EXPECT_EQ(google_apis::HTTP_SUCCESS, 343 EXPECT_EQ(google_apis::HTTP_SUCCESS,
344 fake_drive_service_helper_->ListFilesInFolder( 344 fake_drive_service_helper_->ListFilesInFolder(
345 folder_id, &remote_entries)); 345 folder_id, &remote_entries));
346 std::map<std::string, const google_apis::ResourceEntry*> 346 std::map<std::string, const google_apis::ResourceEntry*>
347 remote_entry_by_title; 347 remote_entry_by_title;
348 for (ScopedVector<google_apis::ResourceEntry>::iterator itr = 348 for (size_t i = 0; i < remote_entries.size(); ++i) {
349 remote_entries.begin(); 349 google_apis::ResourceEntry* remote_entry = remote_entries[i];
350 itr != remote_entries.end(); 350 EXPECT_FALSE(ContainsKey(remote_entry_by_title, remote_entry->title()))
351 ++itr) { 351 << "title: " << remote_entry->title();
352 const google_apis::ResourceEntry& remote_entry = **itr; 352 remote_entry_by_title[remote_entry->title()] = remote_entry;
353 EXPECT_FALSE(ContainsKey(remote_entry_by_title, remote_entry.title()));
354 remote_entry_by_title[remote_entry.title()] = *itr;
355 } 353 }
356 354
357 fileapi::FileSystemURL url(CreateURL(app_id, path)); 355 fileapi::FileSystemURL url(CreateURL(app_id, path));
358 FileEntryList local_entries; 356 FileEntryList local_entries;
359 EXPECT_EQ(base::File::FILE_OK, 357 EXPECT_EQ(base::File::FILE_OK,
360 file_system->ReadDirectory(url, &local_entries)); 358 file_system->ReadDirectory(url, &local_entries));
361 for (FileEntryList::iterator itr = local_entries.begin(); 359 for (FileEntryList::iterator itr = local_entries.begin();
362 itr != local_entries.end(); 360 itr != local_entries.end();
363 ++itr) { 361 ++itr) {
364 const fileapi::DirectoryEntry& local_entry = *itr; 362 const fileapi::DirectoryEntry& local_entry = *itr;
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1581 1579
1582 EXPECT_EQ(1u, CountApp()); 1580 EXPECT_EQ(1u, CountApp());
1583 EXPECT_EQ(1u, CountLocalFile(app_id)); 1581 EXPECT_EQ(1u, CountLocalFile(app_id));
1584 1582
1585 EXPECT_EQ(2u, CountMetadata()); 1583 EXPECT_EQ(2u, CountMetadata());
1586 EXPECT_EQ(2u, CountTracker()); 1584 EXPECT_EQ(2u, CountTracker());
1587 } 1585 }
1588 1586
1589 } // namespace drive_backend 1587 } // namespace drive_backend
1590 } // namespace sync_file_system 1588 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/metadata_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698