summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/automation_messages_internal.h7
-rw-r--r--chrome/test/automation/browser_proxy.cc13
-rw-r--r--chrome/test/automation/browser_proxy.h3
3 files changed, 23 insertions, 0 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index 77f9d56..9f96c5a 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -1396,4 +1396,11 @@ IPC_BEGIN_MESSAGES(Automation)
IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_DeleteCookie, GURL, std::string,
int, bool)
+ // Waits for the download shelf to appear or disappear (depending on
+ // |visibility|) and sets |success| to true on success.
+ IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WaitForDownloadShelfVisibilityChange,
+ int /* browser handle */,
+ bool /* visibility */,
+ bool /* success */)
+
IPC_END_MESSAGES(Automation)
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
index 1b275d8..6456cec 100644
--- a/chrome/test/automation/browser_proxy.cc
+++ b/chrome/test/automation/browser_proxy.cc
@@ -398,6 +398,19 @@ bool BrowserProxy::SetShelfVisible(bool is_visible) {
is_visible));
}
+bool BrowserProxy::WaitForDownloadShelfVisibilityChange(bool visibility) {
+ if (!is_valid())
+ return false;
+
+ bool result = false;
+
+ if (!sender_->Send(new AutomationMsg_WaitForDownloadShelfVisibilityChange(
+ 0, handle_, visibility, &result)))
+ return false;
+
+ return result;
+}
+
bool BrowserProxy::SetIntPreference(const std::wstring& name, int value) {
if (!is_valid())
return false;
diff --git a/chrome/test/automation/browser_proxy.h b/chrome/test/automation/browser_proxy.h
index d0bb4d0..198004a 100644
--- a/chrome/test/automation/browser_proxy.h
+++ b/chrome/test/automation/browser_proxy.h
@@ -178,6 +178,9 @@ class BrowserProxy : public AutomationResourceProxy {
// Shows or hides the download shelf.
bool SetShelfVisible(bool is_visible) WARN_UNUSED_RESULT;
+ // Waits for the download shelf to appear or disappear.
+ bool WaitForDownloadShelfVisibilityChange(bool visibility) WARN_UNUSED_RESULT;
+
// Sets the int value of the specified preference.
bool SetIntPreference(const std::wstring& name, int value) WARN_UNUSED_RESULT;