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

Unified Diff: chrome/browser/ui/webui/settings/downloads_handler_unittest.cc

Issue 2815913005: Switch to using scoped_ptr with UserData (Closed)
Patch Set: rebase Created 3 years, 8 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/ui/webui/settings/downloads_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/settings/downloads_handler_unittest.cc b/chrome/browser/ui/webui/settings/downloads_handler_unittest.cc
index eb4b16d00ee7fb91f9c2bec3b12e04ad9e2f62b2..c20ca4db5821b1e2a7d746cd25309d7e3dcf9e7b 100644
--- a/chrome/browser/ui/webui/settings/downloads_handler_unittest.cc
+++ b/chrome/browser/ui/webui/settings/downloads_handler_unittest.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/settings/downloads_handler.h"
+#include "base/memory/ptr_util.h"
#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/common/pref_names.h"
@@ -23,8 +24,8 @@ class DownloadsHandlerTest : public testing::Test {
: download_manager_(new content::MockDownloadManager()),
chrome_download_manager_delegate_(&profile_),
handler_(&profile_) {
- content::BrowserContext::SetDownloadManagerForTesting(&profile_,
- download_manager_);
+ content::BrowserContext::SetDownloadManagerForTesting(
+ &profile_, base::WrapUnique(download_manager_));
EXPECT_EQ(download_manager_,
content::BrowserContext::GetDownloadManager(&profile_));
@@ -73,8 +74,7 @@ class DownloadsHandlerTest : public testing::Test {
content::TestWebUI test_web_ui_;
TestingProfile profile_;
- // This is heap allocated because its ownership is transferred to |profile_|.
- content::MockDownloadManager* download_manager_;
+ content::MockDownloadManager* download_manager_; // Owned by |profile_|.
ChromeDownloadManagerDelegate chrome_download_manager_delegate_;
DownloadsHandler handler_;

Powered by Google App Engine
This is Rietveld 408576698