Index: content/public/test/download_test_observer.cc |
diff --git a/content/public/test/download_test_observer.cc b/content/public/test/download_test_observer.cc |
index c802b50e0d6ad5838814eb84439ff8815a40510d..49fe7b92a37b1eaed2c6264ee671772d79df6e76 100644 |
--- a/content/public/test/download_test_observer.cc |
+++ b/content/public/test/download_test_observer.cc |
@@ -131,6 +131,12 @@ void DownloadTestObserver::OnDownloadUpdated(DownloadItem* download) { |
DownloadInFinalState(download); |
} |
+void DownloadTestObserver::OnDownloadCreated( |
+ DownloadManager* manager, DownloadItem* item) { |
+ item->AddObserver(this); |
+ downloads_observed_.insert(item); |
+} |
+ |
void DownloadTestObserver::ModelChanged(DownloadManager* manager) { |
DCHECK_EQ(manager, download_manager_); |
@@ -151,6 +157,7 @@ void DownloadTestObserver::ModelChanged(DownloadManager* manager) { |
DownloadSet::iterator observed_it(downloads_observed_.find(*it)); |
// If it isn't finished and we're aren't observing it, start. |
+ // Usually, OnDownloadCreated should have started observing it. |
if (finished_it == finished_downloads_.end() && |
observed_it == downloads_observed_.end()) { |
(*it)->AddObserver(this); |