Index: chrome/browser/download/download_test_observer.cc |
diff --git a/chrome/browser/download/download_test_observer.cc b/chrome/browser/download/download_test_observer.cc |
index 3f11dc2e408f8b28d91efe3654f1f4df955ed430..8a3a250a239198eaec44ee47c6bb3013e507be71 100644 |
--- a/chrome/browser/download/download_test_observer.cc |
+++ b/chrome/browser/download/download_test_observer.cc |
@@ -83,17 +83,15 @@ bool DownloadTestObserver::IsFinished() const { |
return (finish_on_select_file_ && select_file_dialog_seen_); |
} |
-void DownloadTestObserver::OnDownloadUpdated(DownloadItem* download) { |
- // The REMOVING state indicates that the download is being destroyed. |
+void DownloadTestObserver::OnDownloadDestroyed(DownloadItem* download) { |
// Stop observing. Do not do anything with it, as it is about to be gone. |
- if (download->GetState() == DownloadItem::REMOVING) { |
- DownloadSet::iterator it = downloads_observed_.find(download); |
- ASSERT_TRUE(it != downloads_observed_.end()); |
- downloads_observed_.erase(it); |
- download->RemoveObserver(this); |
- return; |
- } |
+ DownloadSet::iterator it = downloads_observed_.find(download); |
+ ASSERT_TRUE(it != downloads_observed_.end()); |
+ downloads_observed_.erase(it); |
+ download->RemoveObserver(this); |
+} |
+void DownloadTestObserver::OnDownloadUpdated(DownloadItem* download) { |
// Real UI code gets the user's response after returning from the observer. |
if (download->GetSafetyState() == DownloadItem::DANGEROUS && |
!ContainsKey(dangerous_downloads_seen_, download->GetId())) { |
@@ -277,17 +275,15 @@ void DownloadTestFlushObserver::ModelChanged(DownloadManager* manager) { |
CheckDownloadsInProgress(true); |
} |
-void DownloadTestFlushObserver::OnDownloadUpdated(DownloadItem* download) { |
- // The REMOVING state indicates that the download is being destroyed. |
+void DownloadTestFlushObserver::OnDownloadDestroyed(DownloadItem* download) { |
// Stop observing. Do not do anything with it, as it is about to be gone. |
- if (download->GetState() == DownloadItem::REMOVING) { |
- DownloadSet::iterator it = downloads_observed_.find(download); |
- ASSERT_TRUE(it != downloads_observed_.end()); |
- downloads_observed_.erase(it); |
- download->RemoveObserver(this); |
- return; |
- } |
+ DownloadSet::iterator it = downloads_observed_.find(download); |
+ ASSERT_TRUE(it != downloads_observed_.end()); |
+ downloads_observed_.erase(it); |
+ download->RemoveObserver(this); |
+} |
+void DownloadTestFlushObserver::OnDownloadUpdated(DownloadItem* download) { |
// No change in DownloadItem set on manager. |
CheckDownloadsInProgress(false); |
} |