| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 virtual ~DownloadTestObserver(); | 53 virtual ~DownloadTestObserver(); |
| 54 | 54 |
| 55 // Wait for the requested number of downloads to enter a terminal state. | 55 // Wait for the requested number of downloads to enter a terminal state. |
| 56 void WaitForFinished(); | 56 void WaitForFinished(); |
| 57 | 57 |
| 58 // Return true if everything's happened that we're configured for. | 58 // Return true if everything's happened that we're configured for. |
| 59 bool IsFinished() const; | 59 bool IsFinished() const; |
| 60 | 60 |
| 61 // content::DownloadItem::Observer | 61 // content::DownloadItem::Observer |
| 62 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 62 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
| 63 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE {} | 63 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
| 64 | 64 |
| 65 // content::DownloadManager::Observer | 65 // content::DownloadManager::Observer |
| 66 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; | 66 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; |
| 67 | 67 |
| 68 size_t NumDangerousDownloadsSeen() const; | 68 size_t NumDangerousDownloadsSeen() const; |
| 69 | 69 |
| 70 size_t NumDownloadsSeenInState( | 70 size_t NumDownloadsSeenInState( |
| 71 content::DownloadItem::DownloadState state) const; | 71 content::DownloadItem::DownloadState state) const; |
| 72 | 72 |
| 73 protected: | 73 protected: |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 explicit DownloadTestFlushObserver( | 195 explicit DownloadTestFlushObserver( |
| 196 content::DownloadManager* download_manager); | 196 content::DownloadManager* download_manager); |
| 197 | 197 |
| 198 void WaitForFlush(); | 198 void WaitForFlush(); |
| 199 | 199 |
| 200 // DownloadsManager observer methods. | 200 // DownloadsManager observer methods. |
| 201 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; | 201 virtual void ModelChanged(content::DownloadManager* manager) OVERRIDE; |
| 202 | 202 |
| 203 // DownloadItem observer methods. | 203 // DownloadItem observer methods. |
| 204 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 204 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; |
| 205 virtual void OnDownloadOpened(content::DownloadItem* download) OVERRIDE {} | 205 virtual void OnDownloadDestroyed(content::DownloadItem* download) OVERRIDE; |
| 206 | 206 |
| 207 protected: | 207 protected: |
| 208 friend class base::RefCountedThreadSafe<DownloadTestFlushObserver>; | 208 friend class base::RefCountedThreadSafe<DownloadTestFlushObserver>; |
| 209 | 209 |
| 210 virtual ~DownloadTestFlushObserver(); | 210 virtual ~DownloadTestFlushObserver(); |
| 211 | 211 |
| 212 private: | 212 private: |
| 213 typedef std::set<content::DownloadItem*> DownloadSet; | 213 typedef std::set<content::DownloadItem*> DownloadSet; |
| 214 | 214 |
| 215 // If we're waiting for that flush point, check the number | 215 // If we're waiting for that flush point, check the number |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 // Returns true if a file chooser dialog was displayed since the last time | 286 // Returns true if a file chooser dialog was displayed since the last time |
| 287 // this method was called. | 287 // this method was called. |
| 288 bool TestAndResetDidShowFileChooser(); | 288 bool TestAndResetDidShowFileChooser(); |
| 289 | 289 |
| 290 private: | 290 private: |
| 291 scoped_refptr<internal::MockFileChooserDownloadManagerDelegate> | 291 scoped_refptr<internal::MockFileChooserDownloadManagerDelegate> |
| 292 test_delegate_; | 292 test_delegate_; |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ | 295 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_TEST_OBSERVER_H_ |
| OLD | NEW |