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

Unified Diff: chrome/browser/download/download_query_unittest.cc

Issue 2457923002: Remove stl_util's deletion function use and ScopedVector from chrome/browser/download/. (Closed)
Patch Set: extra clear Created 4 years, 2 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/download/download_query_unittest.cc
diff --git a/chrome/browser/download/download_query_unittest.cc b/chrome/browser/download/download_query_unittest.cc
index fbdbc0090b24230566d5479f2a43da0121927219..18fada1492766ed9252cda42240abe955bf68845 100644
--- a/chrome/browser/download/download_query_unittest.cc
+++ b/chrome/browser/download/download_query_unittest.cc
@@ -15,7 +15,7 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "base/values.h"
@@ -59,11 +59,12 @@ class DownloadQueryTest : public testing::Test {
~DownloadQueryTest() override {}
- void TearDown() override { base::STLDeleteElements(&mocks_); }
+ void TearDown() override {}
void CreateMocks(int count) {
for (int i = 0; i < count; ++i) {
- mocks_.push_back(new content::MockDownloadItem());
+ owned_mocks_.push_back(base::MakeUnique<content::MockDownloadItem>());
+ mocks_.push_back(owned_mocks_.back().get());
EXPECT_CALL(mock(mocks_.size() - 1), GetId()).WillRepeatedly(Return(
mocks_.size() - 1));
}
@@ -102,6 +103,7 @@ class DownloadQueryTest : public testing::Test {
private:
std::vector<content::MockDownloadItem*> mocks_;
sky 2016/10/28 13:33:59 It's unfortunate that two vectors with the same th
Avi (use Gerrit) 2016/10/28 14:04:10 Done.
+ std::vector<std::unique_ptr<content::MockDownloadItem>> owned_mocks_;
DownloadQuery query_;
DownloadVector results_;

Powered by Google App Engine
This is Rietveld 408576698