summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/automation/automation_messages_internal.h20
-rw-r--r--chrome/test/automation/tab_proxy.cc8
-rw-r--r--chrome/test/automation/tab_proxy.h3
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);