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

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

Issue 2613223002: Remove ScopedVector from base::JSONValueConverter (Closed)
Patch Set: Created 3 years, 11 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
Index: chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc
diff --git a/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc b/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc
index 2ed5052b636c2452076cabfc6be04a6607093ccb..ad9a6d76c0a4c65f6a2f6963d31e5ee6aae076f3 100644
--- a/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc
+++ b/chrome/browser/sync_file_system/drive_backend/drive_backend_sync_unittest.cc
@@ -412,18 +412,14 @@ class DriveBackendSyncTest : public testing::Test,
}
EXPECT_EQ(google_apis::HTTP_SUCCESS, error);
- ScopedVector<google_apis::FileResource> remote_entries;
+ std::vector<std::unique_ptr<google_apis::FileResource>> remote_entries;
EXPECT_EQ(google_apis::HTTP_SUCCESS,
fake_drive_service_helper_->ListFilesInFolder(
sync_root_folder_id, &remote_entries));
std::map<std::string, const google_apis::FileResource*> app_root_by_title;
- for (ScopedVector<google_apis::FileResource>::iterator itr =
- remote_entries.begin();
- itr != remote_entries.end();
- ++itr) {
- const google_apis::FileResource& remote_entry = **itr;
- EXPECT_FALSE(base::ContainsKey(app_root_by_title, remote_entry.title()));
- app_root_by_title[remote_entry.title()] = *itr;
+ for (const auto& remote_entry : remote_entries) {
+ EXPECT_FALSE(base::ContainsKey(app_root_by_title, remote_entry->title()));
Avi (use Gerrit) 2017/01/09 17:18:29 ContainsKey requires #include "base/stl_util.h"
leonhsl(Using Gerrit) 2017/01/10 04:39:36 Done.
+ app_root_by_title[remote_entry->title()] = remote_entry.get();
}
for (std::map<std::string, CannedSyncableFileSystem*>::const_iterator itr =
@@ -446,14 +442,14 @@ class DriveBackendSyncTest : public testing::Test,
CannedSyncableFileSystem* file_system) {
SCOPED_TRACE(testing::Message() << "Verifying folder: " << path.value());
- ScopedVector<google_apis::FileResource> remote_entries;
+ std::vector<std::unique_ptr<google_apis::FileResource>> remote_entries;
EXPECT_EQ(google_apis::HTTP_SUCCESS,
fake_drive_service_helper_->ListFilesInFolder(
folder_id, &remote_entries));
std::map<std::string, const google_apis::FileResource*>
remote_entry_by_title;
for (size_t i = 0; i < remote_entries.size(); ++i) {
- google_apis::FileResource* remote_entry = remote_entries[i];
+ google_apis::FileResource* remote_entry = remote_entries[i].get();
EXPECT_FALSE(
base::ContainsKey(remote_entry_by_title, remote_entry->title()))
<< "title: " << remote_entry->title();

Powered by Google App Engine
This is Rietveld 408576698