diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-30 17:11:03 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-30 17:11:03 +0000 |
commit | 385e93180e0c9498df0c3996ad4e9b709d087fe6 (patch) | |
tree | 72d927007f0901107abd14e5774643f7fa516b4a /content/shell | |
parent | e2dc04b87f64b51cffe00560017b6bcee55c5fad (diff) | |
download | chromium_src-385e93180e0c9498df0c3996ad4e9b709d087fe6.zip chromium_src-385e93180e0c9498df0c3996ad4e9b709d087fe6.tar.gz chromium_src-385e93180e0c9498df0c3996ad4e9b709d087fe6.tar.bz2 |
Move the DownloadManager and DownloadFile unittests to content so they can live beside the code they're testing.
-moved some of the logic about renaming intermediate files into content as the tests depended on them
-made the DownloadManagerDelegate interface have empty default implementations. Darin convinced me that it's better to have delegate interfaces in the API have emptry interfaces, for tests and to make life easier for embedders.
-removed the DownloadItemModel checks; these really were duplicating the DownloadItem::GetState call
-removed the MockDownloadManagerDelegate class since it wasn't being used anymore
-removed DownloadManagerDelegate::OnResponseCompleted since it wasn't called anymore
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9224006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119683 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r-- | content/shell/shell_download_manager_delegate.cc | 73 | ||||
-rw-r--r-- | content/shell/shell_download_manager_delegate.h | 28 |
2 files changed, 0 insertions, 101 deletions
diff --git a/content/shell/shell_download_manager_delegate.cc b/content/shell/shell_download_manager_delegate.cc index 7856a66..9d386b3 100644 --- a/content/shell/shell_download_manager_delegate.cc +++ b/content/shell/shell_download_manager_delegate.cc @@ -36,9 +36,6 @@ void ShellDownloadManagerDelegate::SetDownloadManager( download_manager_ = download_manager; } -void ShellDownloadManagerDelegate::Shutdown() { -} - DownloadId ShellDownloadManagerDelegate::GetNextId() { static int next_id; return DownloadId(this, ++next_id); @@ -141,74 +138,4 @@ void ShellDownloadManagerDelegate::ChooseDownloadPath( } } -bool ShellDownloadManagerDelegate::OverrideIntermediatePath( - DownloadItem* item, - FilePath* intermediate_path) { - return false; -} - -WebContents* ShellDownloadManagerDelegate:: - GetAlternativeWebContentsToNotifyForDownload() { - return NULL; -} - -bool ShellDownloadManagerDelegate::ShouldOpenFileBasedOnExtension( - const FilePath& path) { - return false; -} - -bool ShellDownloadManagerDelegate::ShouldCompleteDownload(DownloadItem* item) { - return true; -} - -bool ShellDownloadManagerDelegate::ShouldOpenDownload(DownloadItem* item) { - return true; -} - -bool ShellDownloadManagerDelegate::GenerateFileHash() { - return false; -} - -void ShellDownloadManagerDelegate::OnResponseCompleted(DownloadItem* item) { -} - -void ShellDownloadManagerDelegate::AddItemToPersistentStore( - DownloadItem* item) { -} - -void ShellDownloadManagerDelegate::UpdateItemInPersistentStore( - DownloadItem* item) { -} - -void ShellDownloadManagerDelegate::UpdatePathForItemInPersistentStore( - DownloadItem* item, - const FilePath& new_path) { -} - -void ShellDownloadManagerDelegate::RemoveItemFromPersistentStore( - DownloadItem* item) { -} - -void ShellDownloadManagerDelegate::RemoveItemsFromPersistentStoreBetween( - base::Time remove_begin, - base::Time remove_end) { -} - -void ShellDownloadManagerDelegate::GetSaveDir( - WebContents* web_contents, - FilePath* website_save_dir, - FilePath* download_save_dir) { -} - -void ShellDownloadManagerDelegate::ChooseSavePath( - WebContents* web_contents, - const FilePath& suggested_path, - const FilePath::StringType& default_extension, - bool can_save_as_complete, - SaveFilePathPickedCallback callback) { -} - -void ShellDownloadManagerDelegate::DownloadProgressUpdated() { -} - } // namespace content diff --git a/content/shell/shell_download_manager_delegate.h b/content/shell/shell_download_manager_delegate.h index 9cb5e97..56afdf6 100644 --- a/content/shell/shell_download_manager_delegate.h +++ b/content/shell/shell_download_manager_delegate.h @@ -24,39 +24,11 @@ class ShellDownloadManagerDelegate void SetDownloadManager(DownloadManager* manager); - virtual void Shutdown() OVERRIDE; virtual DownloadId GetNextId() OVERRIDE; virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; virtual void ChooseDownloadPath(WebContents* web_contents, const FilePath& suggested_path, void* data) OVERRIDE; - virtual bool OverrideIntermediatePath(DownloadItem* item, - FilePath* intermediate_path) OVERRIDE; - virtual WebContents* GetAlternativeWebContentsToNotifyForDownload() OVERRIDE; - virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) OVERRIDE; - virtual bool ShouldCompleteDownload(DownloadItem* item) OVERRIDE; - virtual bool ShouldOpenDownload(DownloadItem* item) OVERRIDE; - virtual bool GenerateFileHash() OVERRIDE; - virtual void OnResponseCompleted(DownloadItem* item) OVERRIDE; - virtual void AddItemToPersistentStore(DownloadItem* item) OVERRIDE; - virtual void UpdateItemInPersistentStore(DownloadItem* item) OVERRIDE; - virtual void UpdatePathForItemInPersistentStore( - DownloadItem* item, - const FilePath& new_path) OVERRIDE; - virtual void RemoveItemFromPersistentStore(DownloadItem* item) OVERRIDE; - virtual void RemoveItemsFromPersistentStoreBetween( - base::Time remove_begin, - base::Time remove_end) OVERRIDE; - virtual void GetSaveDir(WebContents* web_contents, - FilePath* website_save_dir, - FilePath* download_save_dir) OVERRIDE; - virtual void ChooseSavePath( - content::WebContents* web_contents, - const FilePath& suggested_path, - const FilePath::StringType& default_extension, - bool can_save_as_complete, - content::SaveFilePathPickedCallback callback) OVERRIDE; - virtual void DownloadProgressUpdated() OVERRIDE; private: friend class base::RefCountedThreadSafe<ShellDownloadManagerDelegate>; |