diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-09 16:46:25 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-09 16:46:25 +0000 |
commit | 3941c026ba6576a4e21c93f3f08b917505c369a1 (patch) | |
tree | 2dbaad011bd9b20eadfbc25477c20a51a7f60a6e /chrome/test/automation | |
parent | f61b898ba829ce8b1393f5a518a0f28eaafa1408 (diff) | |
download | chromium_src-3941c026ba6576a4e21c93f3f08b917505c369a1.zip chromium_src-3941c026ba6576a4e21c93f3f08b917505c369a1.tar.gz chromium_src-3941c026ba6576a4e21c93f3f08b917505c369a1.tar.bz2 |
Adding support for tab notifications and initializing the focus of an automated tab.
Review URL: http://codereview.chromium.org/20125
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9388 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 20 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.cc | 8 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.h | 3 |
3 files changed, 31 insertions, 0 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index 09c8390..9b31477 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -553,6 +553,26 @@ IPC_BEGIN_MESSAGES(Automation) IPC_MESSAGE_ROUTED2(AutomationMsg_ProcessUnhandledAccelerator, int, MSG) #endif // defined(OS_WIN) + // Sent by the external tab to the host to notify that the user has tabbed + // out of the tab. + // Request: + // - bool: |reverse| set to true when shift-tabbing out of the tab, false + // otherwise. + // Response: + // None expected + IPC_MESSAGE_ROUTED1(AutomationMsg_TabbedOut, bool) + + // Sent by the external tab host to ask focus to be set to either the first + // or last element on the page. + // Request: + // - int: handle of the tab + // - bool: |reverse| + // true: Focus will be set to the last focusable element + // false: Focus will be set to the first focusable element + // Response: + // None expected + IPC_MESSAGE_ROUTED2(AutomationMsg_SetInitialFocus, int, bool) + // This message is an outgoing message from Chrome to an external host. // It is a request to open a url // Request: diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index 61b50cf..e0e6102 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -641,6 +641,14 @@ bool TabProxy::ProcessUnhandledAccelerator(const MSG& msg) { // This message expects no response } +bool TabProxy::SetInitialFocus(bool reverse) { + if (!is_valid()) + return false; + return sender_->Send( + new AutomationMsg_SetInitialFocus(0, handle_, reverse)); + // This message expects no response +} + bool TabProxy::WaitForTabToBeRestored(uint32 timeout_ms) { if (!is_valid()) return false; diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index 932f5c7..f9a8339 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -219,6 +219,9 @@ class TabProxy : public AutomationResourceProxy { // to handle the keys bool ProcessUnhandledAccelerator(const MSG& msg); + // Ask the tab to set focus to either the first or last element on the page. + bool SetInitialFocus(bool reverse); + // Waits for the tab to finish being restored. Returns true on success. // timeout_ms gives the max amount of time to wait for restore to complete. bool WaitForTabToBeRestored(uint32 timeout_ms); |