summaryrefslogtreecommitdiffstats
path: root/content/browser/download/download_manager_impl_unittest.cc
diff options
context:
space:
mode:
authorasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-06 17:43:02 +0000
committerasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-06 17:43:02 +0000
commitb375601e95723c66b63b567c80dfc69544c91c43 (patch)
tree987eaca679895d88fe74af7bfa6c2757badde23e /content/browser/download/download_manager_impl_unittest.cc
parent1c86dbf9eff06098d83f5cf57875ab362e207145 (diff)
downloadchromium_src-b375601e95723c66b63b567c80dfc69544c91c43.zip
chromium_src-b375601e95723c66b63b567c80dfc69544c91c43.tar.gz
chromium_src-b375601e95723c66b63b567c80dfc69544c91c43.tar.bz2
Make the UI an observer of downloads.
This relieves content/browser/download from knowing who/when to notify regarding a new download. BUG=147753 Review URL: https://chromiumcodereview.appspot.com/11640007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/download/download_manager_impl_unittest.cc')
-rw-r--r--content/browser/download/download_manager_impl_unittest.cc18
1 files changed, 2 insertions, 16 deletions
diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc
index 46e43d4..c16713c 100644
--- a/content/browser/download/download_manager_impl_unittest.cc
+++ b/content/browser/download/download_manager_impl_unittest.cc
@@ -181,7 +181,6 @@ class MockDownloadManagerDelegate : public DownloadManagerDelegate {
MOCK_METHOD2(DetermineDownloadTarget,
bool(DownloadItem* item,
const DownloadTargetCallback&));
- MOCK_METHOD0(GetAlternativeWebContentsToNotifyForDownload, WebContents*());
MOCK_METHOD1(ShouldOpenFileBasedOnExtension, bool(const base::FilePath&));
MOCK_METHOD2(ShouldCompleteDownload,
bool(DownloadItem*, const base::Closure&));
@@ -248,6 +247,7 @@ class MockDownloadItemFactory
const GURL& url,
DownloadId download_id,
const std::string& mime_type,
+ scoped_ptr<DownloadRequestHandleInterface> request_handle,
const net::BoundNetLog& bound_net_log) OVERRIDE;
private:
@@ -339,6 +339,7 @@ DownloadItemImpl* MockDownloadItemFactory::CreateSavePageItem(
const GURL& url,
DownloadId download_id,
const std::string& mime_type,
+ scoped_ptr<DownloadRequestHandleInterface> request_handle,
const net::BoundNetLog& bound_net_log) {
int local_id = download_id.local();
DCHECK(items_.find(local_id) == items_.end());
@@ -550,21 +551,6 @@ class DownloadManagerTest : public testing::Test {
base::Unretained(this)));
}
- void AddItemToHistory(MockDownloadItemImpl& item, int64 db_handle) {
- // For DCHECK in AddDownloadItemToHistory. Don't want to use
- // WillRepeatedly as it may have to return true after this.
- if (DCHECK_IS_ON())
- // Null out ShowDownloadInBrowser
- EXPECT_CALL(item, GetWebContents())
- .WillOnce(Return(static_cast<WebContents*>(NULL)));
- EXPECT_CALL(GetMockDownloadManagerDelegate(),
- GetAlternativeWebContentsToNotifyForDownload())
- .WillOnce(Return(static_cast<WebContents*>(NULL)));
-
- EXPECT_CALL(item, IsInProgress())
- .WillOnce(Return(true));
- }
-
protected:
// Key test variable; we'll keep it available to sub-classes.
scoped_refptr<DownloadManagerImpl> download_manager_;