diff options
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 6 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.cc | 11 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.h | 5 |
3 files changed, 22 insertions, 0 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index 82ae220..9c029c4 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -737,6 +737,12 @@ IPC_BEGIN_MESSAGES(Automation, 0) IPC_MESSAGE_ROUTED1(AutomationMsg_OpenFindInPageRequest, int /* tab_handle */) + // Posts a message to the chrome renderer. + IPC_MESSAGE_ROUTED3(AutomationMsg_PostMessage, + int /* automation handle */, + std::string /* target */, + std::string /* message */ ) + // A message for an external host. // |receiver| can be a receiving script and |message| is any // arbitrary string that makes sense to the receiver. diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index c359f34..6171ddb 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -928,3 +928,14 @@ bool TabProxy::SavePage(const std::wstring& file_name, return succeeded; } + +void TabProxy::PostMessage(AutomationHandle handle, + const std::string& target, + const std::string& message) { + if (!is_valid()) + return; + + bool succeeded = + sender_->Send(new AutomationMsg_PostMessage(0, handle, target, message)); + DCHECK(succeeded); +} diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index 6c2e660..24f2cb3 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -265,6 +265,11 @@ class TabProxy : public AutomationResourceProxy { const std::wstring& dir_path, SavePackage::SavePackageType type); + // Posts a message to the external tab. + void PostMessage(AutomationHandle handle, + const std::string& target, + const std::string& message); + private: DISALLOW_EVIL_CONSTRUCTORS(TabProxy); }; |