summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authorfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-27 04:15:31 +0000
committerfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-27 04:15:31 +0000
commit5a52f16a208389a6f8d285cd63333f6bfe17997d (patch)
treed69ae768f9e6d0e1f52021db1760eafa5c17ba1d /chrome/test/automation
parent6eb0876213f6859369ea1c7247a350b0d70cc15b (diff)
downloadchromium_src-5a52f16a208389a6f8d285cd63333f6bfe17997d.zip
chromium_src-5a52f16a208389a6f8d285cd63333f6bfe17997d.tar.gz
chromium_src-5a52f16a208389a6f8d285cd63333f6bfe17997d.tar.bz2
Adding a UI test to catch the crash described in issue 1341577.This test is disabled, and will be turned on once we fix the issue.I added to TabProxy the ability to do FindNext, which was necessary to reproduce the crash, and changed the automation IPC to take a FindInPageRequest struct, which makes it identical to the IPC we pass to render_view.BUG=1341577
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/automation_messages_internal.h16
-rw-r--r--chrome/test/automation/tab_proxy.cc13
-rw-r--r--chrome/test/automation/tab_proxy.h13
3 files changed, 32 insertions, 10 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h
index c04aa65..ca8553a 100644
--- a/chrome/test/automation/automation_messages_internal.h
+++ b/chrome/test/automation/automation_messages_internal.h
@@ -16,6 +16,7 @@
#include "chrome/common/navigation_types.h"
#include "chrome/test/automation/autocomplete_edit_proxy.h"
#include "googleurl/src/gurl.h"
+#include "webkit/glue/find_in_page_request.h"
// NOTE: All IPC messages have either a routing_id of 0 (for asynchronous
// messages), or one that's been assigned by the proxy (for calls
@@ -309,6 +310,10 @@ IPC_BEGIN_MESSAGES(Automation, 0)
// direction (1=forward, 0=back), 'match_case' specifies case sensitivity
// (1=case sensitive, 0=case insensitive). If an error occurs, matches_found
// will be -1.
+ //
+ // NOTE: This message has been deprecated, please use the new message
+ // AutomationMsg_FindRequest below.
+ //
IPC_MESSAGE_ROUTED4(AutomationMsg_FindInPageRequest,
int, /* tab_handle */
std::wstring, /* find_request */
@@ -708,7 +713,7 @@ IPC_BEGIN_MESSAGES(Automation, 0)
bool /* success flag */)
// This message opens the Find window within a tab corresponding to the
- // supplied tab handle.
+ // supplied tab handle.
IPC_MESSAGE_ROUTED1(AutomationMsg_OpenFindInPageRequest,
int /* tab_handle */)
@@ -725,5 +730,14 @@ IPC_BEGIN_MESSAGES(Automation, 0)
std::string /* receiver*/,
std::string /* message*/)
+ // This message starts a find within a tab corresponding to the supplied
+ // tab handle. The parameter |request| specifies what to search for.
+ // If an error occurs, |matches_found| will be -1 (see response message
+ // AutomationMsg_FindInPageResponse).
+ //
+ IPC_MESSAGE_ROUTED2(AutomationMsg_FindRequest,
+ int, /* tab_handle */
+ FindInPageRequest /* request */)
+
IPC_END_MESSAGES(Automation)
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index 2226714..e3529b5 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -78,14 +78,21 @@ bool TabProxy::OpenFindInPage() {
int TabProxy::FindInPage(const std::wstring& search_string,
FindInPageDirection forward,
- FindInPageCase match_case) {
+ FindInPageCase match_case,
+ bool find_next) {
if (!is_valid())
return -1;
+ FindInPageRequest request = {0};
+ request.search_string = search_string;
+ request.find_next = find_next;
+ // The explicit comparison to TRUE avoids a warning (C4800).
+ request.match_case = match_case == TRUE;
+ request.forward = forward == TRUE;
+
IPC::Message* response = NULL;
bool succeeded = sender_->SendAndWaitForResponse(
- new AutomationMsg_FindInPageRequest(0, handle_, search_string,
- forward, match_case),
+ new AutomationMsg_FindRequest(0, handle_, request),
&response,
AutomationMsg_FindInPageResponse::ID);
if (!succeeded)
diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h
index 3b3bf4f..c1c156b 100644
--- a/chrome/test/automation/tab_proxy.h
+++ b/chrome/test/automation/tab_proxy.h
@@ -167,12 +167,13 @@ class TabProxy : public AutomationResourceProxy {
// you don't need to call this function, just use FindInPage(...) directly.
bool OpenFindInPage();
- // 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
- // (true=case sensitive). A return value of -1 indicates failure.
+ // 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
+ // (true=case sensitive). |find_next| specifies whether this is a new search
+ // or a continuation of the old one. A return value of -1 indicates failure.
int FindInPage(const std::wstring& search_string, FindInPageDirection forward,
- FindInPageCase match_case);
+ FindInPageCase match_case, bool find_next);
bool GetCookies(const GURL& url, std::string* cookies);
bool GetCookieByName(const GURL& url,
@@ -246,7 +247,7 @@ class TabProxy : public AutomationResourceProxy {
const std::string& message);
private:
- DISALLOW_EVIL_CONSTRUCTORS(TabProxy);
+ DISALLOW_COPY_AND_ASSIGN(TabProxy);
};
#endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_