diff options
author | iyengar@google.com <iyengar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-15 21:22:15 +0000 |
---|---|---|
committer | iyengar@google.com <iyengar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-15 21:22:15 +0000 |
commit | 3ac14a058599a1381224264784ad4000934f0119 (patch) | |
tree | c67e92c258ee19a378be5acfdb5741d2d2085bab /chrome/test/automation | |
parent | b5e3bbf106f2bda83900e526d07dfa10a2164c82 (diff) | |
download | chromium_src-3ac14a058599a1381224264784ad4000934f0119.zip chromium_src-3ac14a058599a1381224264784ad4000934f0119.tar.gz chromium_src-3ac14a058599a1381224264784ad4000934f0119.tar.bz2 |
Added support for PostMessage from the automation framework to
the renderer.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@964 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-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); }; |