summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authorfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-28 16:31:57 +0000
committerfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-28 16:31:57 +0000
commit20e93d1f20dc0e3c626a2500c96f85e89cf184c9 (patch)
tree80307da7589ce802e88ca79c6b60493496770e80 /chrome/test/automation
parent50664fdc92a8d1db14d83c902f67b7a8dce76480 (diff)
downloadchromium_src-20e93d1f20dc0e3c626a2500c96f85e89cf184c9.zip
chromium_src-20e93d1f20dc0e3c626a2500c96f85e89cf184c9.tar.gz
chromium_src-20e93d1f20dc0e3c626a2500c96f85e89cf184c9.tar.bz2
Adding a test to catch regressions where the Find box moves when you open and close a tab. Test is disabled until we fix the bug.
Also made the error message for when tests fails because crash_service isn't running a bit explicit (unrelated to the rest of this change). BUG=1343052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/automation_messages_internal.h13
-rw-r--r--chrome/test/automation/tab_proxy.cc42
-rw-r--r--chrome/test/automation/tab_proxy.h8
3 files changed, 63 insertions, 0 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index ca8553a..57a4f3e 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -739,5 +739,18 @@ IPC_BEGIN_MESSAGES(Automation, 0)
int, /* tab_handle */
FindInPageRequest /* request */)
+ // Is the Find window fully visible (and not animating) for the specified
+ // tab?
+ IPC_MESSAGE_ROUTED1(AutomationMsg_FindWindowVisibilityRequest,
+ int /* tab_handle */)
+ IPC_MESSAGE_ROUTED1(AutomationMsg_FindWindowVisibilityResponse,
+ bool /* is_visible */)
+
+ // Where is the Find window located. |x| and |y| will be -1, -1 on failure.
+ IPC_MESSAGE_ROUTED1(AutomationMsg_FindWindowLocationRequest,
+ int /* tab_handle */)
+ IPC_MESSAGE_ROUTED2(AutomationMsg_FindWindowLocationResponse,
+ int, /* x */
+ int /* y */)
IPC_END_MESSAGES(Automation)
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index e3529b5..f284b26 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -76,6 +76,48 @@ bool TabProxy::OpenFindInPage() {
// This message expects no response.
}
+bool TabProxy::IsFindWindowFullyVisible(bool* is_visible) {
+ if (!is_valid())
+ return false;
+
+ if (!is_visible) {
+ NOTREACHED();
+ return false;
+ }
+
+ IPC::Message* response = NULL;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_FindWindowVisibilityRequest(0, handle_),
+ &response,
+ AutomationMsg_FindWindowVisibilityResponse::ID);
+ if (!succeeded)
+ return false;
+
+ void* iter = NULL;
+ response->ReadBool(&iter, is_visible);
+ delete response;
+ return true;
+}
+
+bool TabProxy::GetFindWindowLocation(int* x, int* y) {
+ if (!is_valid() || !x || !y)
+ return false;
+
+ IPC::Message* response = NULL;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_FindWindowLocationRequest(0, handle_),
+ &response,
+ AutomationMsg_FindWindowLocationResponse::ID);
+ if (!succeeded)
+ return false;
+
+ void* iter = NULL;
+ response->ReadInt(&iter, x);
+ response->ReadInt(&iter, y);
+ delete response;
+ return true;
+}
+
int TabProxy::FindInPage(const std::wstring& search_string,
FindInPageDirection forward,
FindInPageCase match_case,
diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h
index c1c156b..b135288 100644
--- a/chrome/test/automation/tab_proxy.h
+++ b/chrome/test/automation/tab_proxy.h
@@ -167,6 +167,14 @@ class TabProxy : public AutomationResourceProxy {
// you don't need to call this function, just use FindInPage(...) directly.
bool OpenFindInPage();
+ // Returns whether the Find window is fully visible If animating, |is_visible|
+ // will be false. Returns false on failure.
+ bool IsFindWindowFullyVisible(bool* is_visible);
+
+ // Get the x, y coordinates for the Find window. If animating, |x| and |y|
+ // will be -1, -1. Returns false on failure.
+ bool GetFindWindowLocation(int* x, int* y);
+
// Starts a search within the current tab. The parameter |search_string|
// specifies what string to search for, |forward| specifies whether to search
// in forward direction, and |match_case| specifies case sensitivity