summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation
diff options
context:
space:
mode:
authoriyengar@google.com <iyengar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 21:22:15 +0000
committeriyengar@google.com <iyengar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 21:22:15 +0000
commit3ac14a058599a1381224264784ad4000934f0119 (patch)
treec67e92c258ee19a378be5acfdb5741d2d2085bab /chrome/test/automation
parentb5e3bbf106f2bda83900e526d07dfa10a2164c82 (diff)
downloadchromium_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.h6
-rw-r--r--chrome/test/automation/tab_proxy.cc11
-rw-r--r--chrome/test/automation/tab_proxy.h5
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);
};