summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_shelf_unittest.cc
diff options
context:
space:
mode:
authorcaio.de.oliveira.filho@intel.com <caio.de.oliveira.filho@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-29 02:18:06 +0000
committercaio.de.oliveira.filho@intel.com <caio.de.oliveira.filho@intel.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-29 02:18:06 +0000
commiteba4a4d2ae2cd9ac349c3a841779b4521b7d9bd5 (patch)
tree5d56d4858c931b1fb2d37687c205f0a8e0f40854 /chrome/browser/download/download_shelf_unittest.cc
parentdc1a7fed64f98bde211a369187900d38f48dba3d (diff)
downloadchromium_src-eba4a4d2ae2cd9ac349c3a841779b4521b7d9bd5.zip
chromium_src-eba4a4d2ae2cd9ac349c3a841779b4521b7d9bd5.tar.gz
chromium_src-eba4a4d2ae2cd9ac349c3a841779b4521b7d9bd5.tar.bz2
BrowserContext should simply own DownloadManager
This patch changes BrowserContext so it store a DownloadManager directly (as UserData), instead of storing a refptr to it. Client code (mostly tests) that used refptrs was changed to use either raw pointers or to use scoped_ptr/ScopedVector in case of DownloadManagers created by it. The Bind() in DownloadManagerImpl::CheckForFileRemoval() is now using a weak pointer to itself. BUG=237871 TEST=content_unittests and {unit,browser}_tests with *Download* and *SavePage* Review URL: https://chromiumcodereview.appspot.com/15701007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202743 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_shelf_unittest.cc')
-rw-r--r--chrome/browser/download/download_shelf_unittest.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/download/download_shelf_unittest.cc b/chrome/browser/download/download_shelf_unittest.cc
index ad78008..2f1963d 100644
--- a/chrome/browser/download/download_shelf_unittest.cc
+++ b/chrome/browser/download/download_shelf_unittest.cc
@@ -43,7 +43,7 @@ class DownloadShelfTest : public testing::Test {
base::MessageLoopForUI message_loop_;
content::TestBrowserThread ui_thread_;
scoped_ptr<content::MockDownloadItem> download_item_;
- scoped_refptr<content::MockDownloadManager> download_manager_;
+ scoped_ptr<content::MockDownloadManager> download_manager_;
TestDownloadShelf shelf_;
};
@@ -63,7 +63,8 @@ DownloadShelfTest::DownloadShelfTest()
ON_CALL(*download_item_, ShouldOpenFileBasedOnExtension())
.WillByDefault(Return(false));
- download_manager_ = new ::testing::NiceMock<content::MockDownloadManager>();
+ download_manager_.reset(
+ new ::testing::NiceMock<content::MockDownloadManager>());
ON_CALL(*download_manager_, GetDownload(_))
.WillByDefault(Return(download_item_.get()));