diff options
author | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-06 22:49:45 +0000 |
---|---|---|
committer | finnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-06 22:49:45 +0000 |
commit | 5f8af2aa221fd2fba282dd51dc0837829cd48967 (patch) | |
tree | d81334eb34cce1b935767194a829d650116b1213 /chrome/test | |
parent | b63cbfaf62c1119b1f4b715d0186e516a2444600 (diff) | |
download | chromium_src-5f8af2aa221fd2fba282dd51dc0837829cd48967.zip chromium_src-5f8af2aa221fd2fba282dd51dc0837829cd48967.tar.gz chromium_src-5f8af2aa221fd2fba282dd51dc0837829cd48967.tar.bz2 |
Adding an interactive UI test to catch when switching between two tabs (both with FindInPage open) is trashing the Esc handler and causing a crash.
I originally tried an automated_ui test, but was unable to get it to work since Focus changes are involved.
BUG=1303709
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 4 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.cc | 9 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.h | 10 | ||||
-rw-r--r-- | chrome/test/interactive_ui/interactive_ui.vcproj | 8 |
4 files changed, 28 insertions, 3 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index f6efda3..bbd1782 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -732,4 +732,8 @@ IPC_BEGIN_MESSAGES(Automation, 0) IPC_MESSAGE_ROUTED1(AutomationMsg_WindowExecuteCommandResponse, bool /* success flag */) + // This message opens the Find window within a tab corresponding to the + // supplied tab handle. + IPC_MESSAGE_ROUTED1(AutomationMsg_OpenFindInPageRequest, + int /* tab_handle */) IPC_END_MESSAGES(Automation) diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index 4fb4432..2cca9a4 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -92,6 +92,15 @@ bool TabProxy::IsShelfVisible(bool* is_visible) { return true; } +bool TabProxy::OpenFindInPage() { + if (!is_valid()) + return false; + + return sender_->Send( + new AutomationMsg_OpenFindInPageRequest(0, handle_)); + // This message expects no response. +} + 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 712ab9c..baa5a0f 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -27,8 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CHROME_TEST_AUTOMATION_TAB_PROXY_H__ -#define CHROME_TEST_AUTOMATION_TAB_PROXY_H__ +#ifndef CHROME_TEST_AUTOMATION_TAB_PROXY_H_ +#define CHROME_TEST_AUTOMATION_TAB_PROXY_H_ #include <wtypes.h> #include <string> @@ -188,6 +188,10 @@ 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(); + // 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 @@ -263,4 +267,4 @@ class TabProxy : public AutomationResourceProxy { DISALLOW_EVIL_CONSTRUCTORS(TabProxy); }; -#endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H__ +#endif // CHROME_TEST_AUTOMATION_TAB_PROXY_H_ diff --git a/chrome/test/interactive_ui/interactive_ui.vcproj b/chrome/test/interactive_ui/interactive_ui.vcproj index 56c649f..b29342a 100644 --- a/chrome/test/interactive_ui/interactive_ui.vcproj +++ b/chrome/test/interactive_ui/interactive_ui.vcproj @@ -180,6 +180,14 @@ </File> </Filter> <Filter + Name="TestFindInPage" + > + <File + RelativePath="..\..\browser\find_in_page_controller_interactive_uitest.cc" + > + </File> + </Filter> + <Filter Name="TestFocus" > <File |