summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation/browser_proxy.cc
diff options
context:
space:
mode:
authorjcampan@google.com <jcampan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 23:28:47 +0000
committerjcampan@google.com <jcampan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-04 23:28:47 +0000
commit4ae627586ecb6184c3b766fd5128709442b17360 (patch)
tree44726dd64ec639e8545b189c52f9bb6de1ecb818 /chrome/test/automation/browser_proxy.cc
parent41c2cd46aecd34eb258ed92b242ee86c333f06a8 (diff)
downloadchromium_src-4ae627586ecb6184c3b766fd5128709442b17360.zip
chromium_src-4ae627586ecb6184c3b766fd5128709442b17360.tar.gz
chromium_src-4ae627586ecb6184c3b766fd5128709442b17360.tar.bz2
Another attempt at this CL.
I had to revert because it was somehow causing regressions on the page cycler and start-up tests. (I suspect because I did add an IPC message not at the end of the message list) TBR=beng git-svn-id: svn://svn.chromium.org/chrome/trunk/src@351 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation/browser_proxy.cc')
-rw-r--r--chrome/test/automation/browser_proxy.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc
index 81b8900..68e41ba 100644
--- a/chrome/test/automation/browser_proxy.cc
+++ b/chrome/test/automation/browser_proxy.cc
@@ -346,3 +346,24 @@ bool BrowserProxy::GetHWND(HWND* handle) const {
return succeeded;
}
+
+bool BrowserProxy::RunCommand(int browser_command) const {
+ if (!is_valid())
+ return false;
+
+ IPC::Message* response = NULL;
+ bool succeeded = sender_->SendAndWaitForResponse(
+ new AutomationMsg_WindowExecuteCommandRequest(0, handle_, browser_command),
+ &response, AutomationMsg_WindowExecuteCommandResponse::ID);
+
+ scoped_ptr<IPC::Message> response_deleter(response); // Delete on return.
+ if (!succeeded)
+ return false;
+
+ bool success = false;
+ if (AutomationMsg_WindowExecuteCommandResponse::Read(response, &success))
+ return success;
+
+ // We failed to deserialize the returned value.
+ return false;
+}