Index: chrome/browser/download/download_test_observer.h |
diff --git a/chrome/browser/download/download_test_observer.h b/chrome/browser/download/download_test_observer.h |
index 3404f425e3c9d6fc57beb11ee7ca6e49536a251b..60104b77ae2d90782faa94f0705ad546cb06aca5 100644 |
--- a/chrome/browser/download/download_test_observer.h |
+++ b/chrome/browser/download/download_test_observer.h |
@@ -73,6 +73,10 @@ class DownloadTestObserver : public content::DownloadManager::Observer, |
size_t NumDangerousDownloadsSeen() const; |
+ // If we finish other than because we met the condtions, call this to find |
+ // out how many rogue downloads there were. |
+ size_t NumOtherDownloadsSeen() const; |
Randy Smith (Not in Mondays)
2012/03/01 21:07:53
In context, it isn't clear what "rogue downloads"
ahendrickson
2012/03/02 17:29:41
Changed the comment.
|
+ |
private: |
typedef std::set<content::DownloadItem*> DownloadSet; |
@@ -82,11 +86,25 @@ class DownloadTestObserver : public content::DownloadManager::Observer, |
// that state. So we keep our own track of transitions into final. |
void DownloadInFinalState(content::DownloadItem* download); |
+ // Called when we think the download item is in a terminal state. |
+ void DownloadInTerminalState(content::DownloadItem* download); |
+ |
void SignalIfFinished(); |
// The observed download manager. |
scoped_refptr<content::DownloadManager> download_manager_; |
+ // The set of |DownloadItem|s that have transitioned to a final state before |
+ // we start. Will not overlap with |finished_downloads_|. |
+ DownloadSet previously_finished_downloads_; |
+ |
+ // The set of |DownloadItem|s that have transitioned to a final state without |
+ // having hit the 'finished' state. Will not overlap with |
+ // |finished_downloads_|. |
+ // This is so the test will finish even if it doesn't have the expected |
+ // result. |
+ DownloadSet finished_other_downloads_; |
+ |
// The set of DownloadItem's that have transitioned to their finished state |
// since construction of this object. When the size of this array |
// reaches wait_count_, we're done. |