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

Unified Diff: chrome/browser/download/download_test_observer.h

Issue 9568003: Fixed issue with DownloadTestObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 8 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/download/download_test_observer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ffa4d8fcc6ad7e7f23b267da71641c3346cfc210 100644
--- a/chrome/browser/download/download_test_observer.h
+++ b/chrome/browser/download/download_test_observer.h
@@ -73,6 +73,8 @@ class DownloadTestObserver : public content::DownloadManager::Observer,
size_t NumDangerousDownloadsSeen() const;
+ size_t NumOtherDownloadsSeen() const;
+
private:
typedef std::set<content::DownloadItem*> DownloadSet;
@@ -82,11 +84,26 @@ 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.
+ // Should never be called normally, only when there's a problem with a test.
ahendrickson 2012/03/01 20:20:14 Remove 2nd line of comment. It's incorrect.
ahendrickson 2012/03/01 20:38:39 Done.
+ 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. May overlap with |finished_downloads_|.
ahendrickson 2012/03/01 20:20:14 May -> Will not
ahendrickson 2012/03/01 20:38:39 Done.
+ DownloadSet previously_finished_downloads_;
benjhayden 2012/03/01 19:58:32 So now we have 4 DownloadSets. It seems that it wo
ahendrickson 2012/03/01 20:38:39 I think the code would be more cluttered. Yes, we
+
+ // 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.
« no previous file with comments | « no previous file | chrome/browser/download/download_test_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698