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

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

Issue 2457923002: Remove stl_util's deletion function use and ScopedVector from chrome/browser/download/. (Closed)
Patch Set: sky 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
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_query.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_history_unittest.cc
diff --git a/chrome/browser/download/download_history_unittest.cc b/chrome/browser/download/download_history_unittest.cc
index cbebd5517844b010de64df223e49b318490df553..04a22bf56d5e498cbb83c5be617422f1f863dfd1 100644
--- a/chrome/browser/download/download_history_unittest.cc
+++ b/chrome/browser/download/download_history_unittest.cc
@@ -11,6 +11,7 @@
#include "base/guid.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/weak_ptr.h"
#include "base/rand_util.h"
#include "base/stl_util.h"
@@ -191,7 +192,7 @@ class DownloadHistoryTest : public testing::Test {
history_(NULL),
manager_observer_(NULL),
download_created_index_(0) {}
- ~DownloadHistoryTest() override { base::STLDeleteElements(&items_); }
+ ~DownloadHistoryTest() override {}
protected:
void TearDown() override { download_history_.reset(); }
@@ -366,8 +367,7 @@ class DownloadHistoryTest : public testing::Test {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
size_t index = items_.size();
- StrictMockDownloadItem* mock_item = new StrictMockDownloadItem();
- items_.push_back(mock_item);
+ items_.push_back(base::MakeUnique<StrictMockDownloadItem>());
info->current_path = current_path;
info->target_path = target_path;
@@ -459,7 +459,7 @@ class DownloadHistoryTest : public testing::Test {
base::MessageLoopForUI loop_;
content::TestBrowserThread ui_thread_;
- std::vector<StrictMockDownloadItem*> items_;
+ std::vector<std::unique_ptr<StrictMockDownloadItem>> items_;
std::unique_ptr<content::MockDownloadManager> manager_;
FakeHistoryAdapter* history_;
std::unique_ptr<DownloadHistory> download_history_;
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_query.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698