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

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

Issue 11941015: Move OpenItem/ShowItemInFolder from ContentBrowserClient to DownloadManagerDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: _ Created 7 years, 11 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/download/download_browsertest.cc
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index 66830adfd89606b4040686c0a8c5cb1e63ff5a5f..c2a7678e7b5145e09f444111e3270fc5ada746ba 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -167,30 +167,6 @@ void SetHiddenDownloadCallback(DownloadItem* item, net::Error error) {
} // namespace
-// While an object of this class exists, it will mock out download
-// opening for all downloads created on the specified download manager.
-class MockDownloadOpeningObserver : public DownloadManager::Observer {
- public:
- explicit MockDownloadOpeningObserver(DownloadManager* manager)
- : download_manager_(manager) {
- download_manager_->AddObserver(this);
- }
-
- ~MockDownloadOpeningObserver() {
- download_manager_->RemoveObserver(this);
- }
-
- virtual void OnDownloadCreated(
- DownloadManager* manager, DownloadItem* item) OVERRIDE {
- item->MockDownloadOpenForTesting();
- }
-
- private:
- DownloadManager* download_manager_;
-
- DISALLOW_COPY_AND_ASSIGN(MockDownloadOpeningObserver);
-};
-
class HistoryObserver : public DownloadHistory::Observer {
public:
explicit HistoryObserver(Profile* profile)
@@ -1487,8 +1463,7 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, AutoOpen) {
ASSERT_TRUE(
GetDownloadPrefs(browser())->EnableAutoOpenBasedOnExtension(file));
- // Mock out external opening on all downloads until end of test.
- MockDownloadOpeningObserver observer(DownloadManagerForBrowser(browser()));
+ DownloadManagerForBrowser(browser())->MockDownloadOpenForTesting();
Randy Smith (Not in Mondays) 2013/01/18 18:53:37 The better way to do this (given that the DMD now
hashimoto 2013/01/21 10:54:25 Filed in http://crbug.com/171224.
DownloadAndWait(browser(), url);

Powered by Google App Engine
This is Rietveld 408576698