summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authorfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-24 00:10:29 +0000
committerfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-24 00:10:29 +0000
commit4f3dc3751d69f9db1f8ef533a3335201b3bc78bc (patch)
treee37efecf992ddd4e901c894273cbb1e5bf4260cc /chrome/test/automation
parent5e7f161f73f1817b8a0c422c0e4b5eceae6954e7 (diff)
downloadchromium_src-4f3dc3751d69f9db1f8ef533a3335201b3bc78bc.zip
chromium_src-4f3dc3751d69f9db1f8ef533a3335201b3bc78bc.tar.gz
chromium_src-4f3dc3751d69f9db1f8ef533a3335201b3bc78bc.tar.bz2
The find bar should be owned and managed from the BrowserView, not the WebContentsView, since it's part of the "chrome".
Design Doc: http://dev.chromium.org/developers/design-documents/find-bar Things done: - Pulled all of the find bar stuff out of WebContentsView* since it's no longer needed. - Moved OnFindReply delegate method from RenderViewHostDelegate::View to RenderViewHostDelegate, since it's no longer implemented on the view. - Moved find control methods to WebContents. - Added recent find result state to WebContents. - Updated the UI tests to accommodate the changes in the state that is broadcast when results are discovered. - Updated the find bar layout to obtain its bounding box from the BrowserView, which knows about toolbars, bookmark bars etc. - Updated the find bar itself to handle the fact that it can be displayed for multiple different tabs. - Moved the find bar manipulation methods for testing from TabProxy to BrowserProxy, since the find bar is now a feature of the window, not the tab. - view.h: Don't lay out child views again if they have a layout manager, it already updated them. TEST=Find box should work as before. BUG=3245 Review URL: http://codereview.chromium.org/27025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r--chrome/test/automation/browser_proxy.cc31
-rw-r--r--chrome/test/automation/browser_proxy.h12
-rw-r--r--chrome/test/automation/tab_proxy.cc29
-rw-r--r--chrome/test/automation/tab_proxy.h12
4 files changed, 42 insertions, 42 deletions
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
index 87f2746..c13fd29 100644
--- a/chrome/test/automation/browser_proxy.cc
+++ b/chrome/test/automation/browser_proxy.cc
@@ -251,6 +251,35 @@ bool BrowserProxy::WaitForTabToBecomeActive(int tab,
return false;
}
+bool BrowserProxy::OpenFindInPage() {
+ if (!is_valid())
+ return false;
+
+ return sender_->Send(new AutomationMsg_OpenFindInPage(0, handle_));
+ // This message expects no response.
+}
+
+bool BrowserProxy::GetFindWindowLocation(int* x, int* y) {
+ if (!is_valid() || !x || !y)
+ return false;
+
+ return sender_->Send(
+ new AutomationMsg_FindWindowLocation(0, handle_, x, y));
+}
+
+bool BrowserProxy::IsFindWindowFullyVisible(bool* is_visible) {
+ if (!is_valid())
+ return false;
+
+ if (!is_visible) {
+ NOTREACHED();
+ return false;
+ }
+
+ return sender_->Send(
+ new AutomationMsg_FindWindowVisibility(0, handle_, is_visible));
+}
+
bool BrowserProxy::GetHWND(HWND* handle) const {
if (!is_valid())
return false;
@@ -319,7 +348,7 @@ bool BrowserProxy::GetBooleanPreference(const std::wstring& name,
return false;
bool result = false;
-
+
sender_->Send(new AutomationMsg_GetBooleanPreference(0, handle_, name, value,
&result));
return result;
diff --git a/chrome/test/automation/browser_proxy.h b/chrome/test/automation/browser_proxy.h
index 4df9269..9a61993 100644
--- a/chrome/test/automation/browser_proxy.h
+++ b/chrome/test/automation/browser_proxy.h
@@ -144,6 +144,18 @@ class BrowserProxy : public AutomationResourceProxy {
// Returns false if the tab does not become active.
bool WaitForTabToBecomeActive(int tab, int wait_timeout);
+ // Opens the FindInPage box. Note: If you just want to search within a tab
+ // you don't need to call this function, just use FindInPage(...) directly.
+ bool OpenFindInPage();
+
+ // 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);
+
+ // Returns whether the Find window is fully visible If animating, |is_visible|
+ // will be false. Returns false on failure.
+ bool IsFindWindowFullyVisible(bool* is_visible);
+
// Gets the outermost HWND that corresponds to the given browser.
// Returns true if the call was successful.
// Note that ideally this should go and the version of WindowProxy should be
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index f0f9a72..e36d683 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -43,35 +43,6 @@ bool TabProxy::IsShelfVisible(bool* is_visible) {
is_visible));
}
-bool TabProxy::OpenFindInPage() {
- if (!is_valid())
- return false;
-
- return sender_->Send(new AutomationMsg_OpenFindInPage(0, handle_));
- // This message expects no response.
-}
-
-bool TabProxy::IsFindWindowFullyVisible(bool* is_visible) {
- if (!is_valid())
- return false;
-
- if (!is_visible) {
- NOTREACHED();
- return false;
- }
-
- return sender_->Send(new AutomationMsg_FindWindowVisibility(
- 0, handle_, is_visible));
-}
-
-bool TabProxy::GetFindWindowLocation(int* x, int* y) {
- if (!is_valid() || !x || !y)
- return false;
-
- return sender_->Send(new AutomationMsg_FindWindowLocation(
- 0, handle_, x, y));
-}
-
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 f9a8339..1e393f54 100644
--- a/chrome/test/automation/tab_proxy.h
+++ b/chrome/test/automation/tab_proxy.h
@@ -159,18 +159,6 @@ class TabProxy : public AutomationResourceProxy {
// unchanged.
bool IsShelfVisible(bool* is_visible);
- // Opens the FindInPage box. Note: If you just want to search within a tab
- // 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