summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_provider_observers.h
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 11:49:08 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-07 11:49:08 +0000
commit585b6bdeaf4104d26311f09dbb99f5085b5becb6 (patch)
tree737e492a12c1577ed730952080160fa07304fb12 /chrome/browser/automation/automation_provider_observers.h
parent88e71dc17b86efc2f4d70dee9a1bb4a71f86adc9 (diff)
downloadchromium_src-585b6bdeaf4104d26311f09dbb99f5085b5becb6.zip
chromium_src-585b6bdeaf4104d26311f09dbb99f5085b5becb6.tar.gz
chromium_src-585b6bdeaf4104d26311f09dbb99f5085b5becb6.tar.bz2
Add AutomationMsg_WaitForDownloadShelfVisibilityChange and use it in UITestBase for the download tests.
This should decrease flakiness of download tests. TEST=DownloadTest.*, especially DownloadTest.[Dont]CloseNewTab* BUG=43066 Review URL: http://codereview.chromium.org/1933005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_provider_observers.h')
-rw-r--r--chrome/browser/automation/automation_provider_observers.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.h b/chrome/browser/automation/automation_provider_observers.h
index efb01e0..1821d33 100644
--- a/chrome/browser/automation/automation_provider_observers.h
+++ b/chrome/browser/automation/automation_provider_observers.h
@@ -488,6 +488,28 @@ class LoginManagerObserver : public NotificationObserver {
};
#endif
+// Waits for the download shelf to appear or disappear
+// (depending on |visibility|).
+class DownloadShelfVisibilityObserver : public NotificationObserver {
+ public:
+ DownloadShelfVisibilityObserver(AutomationProvider* automation,
+ Browser* browser,
+ bool visiblity,
+ IPC::Message* reply_message);
+
+ // NotificationObserver interface.
+ virtual void Observe(NotificationType type, const NotificationSource& source,
+ const NotificationDetails& details);
+
+ private:
+ NotificationRegistrar registrar_;
+ AutomationProvider* automation_;
+ bool visibility_;
+ IPC::Message* reply_message_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadShelfVisibilityObserver);
+};
+
// Waits for the bookmark model to load.
class AutomationProviderBookmarkModelObserver : BookmarkModelObserver {
public:
@@ -536,8 +558,8 @@ class AutomationProviderBookmarkModelObserver : BookmarkModelObserver {
// When asked for pending downloads, the DownloadManager places
// results in a DownloadManager::Observer.
-class AutomationProviderDownloadManagerObserver :
- public DownloadManager::Observer {
+class AutomationProviderDownloadManagerObserver
+ : public DownloadManager::Observer {
public:
AutomationProviderDownloadManagerObserver() : DownloadManager::Observer() {}
virtual ~AutomationProviderDownloadManagerObserver() {}