summaryrefslogtreecommitdiffstats
path: root/chrome/test/automation/automation_proxy.cc
diff options
context:
space:
mode:
authorkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 17:52:19 +0000
committerkkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-06 17:52:19 +0000
commit790788ac7de91db6f349a0ecd1c98fd240b73ca2 (patch)
tree7fa4cb0c072c2e9d75b9654284273af55cf8586f /chrome/test/automation/automation_proxy.cc
parent86ba6fa82610b38aaf45e3a5497320ddcfb87d79 (diff)
downloadchromium_src-790788ac7de91db6f349a0ecd1c98fd240b73ca2.zip
chromium_src-790788ac7de91db6f349a0ecd1c98fd240b73ca2.tar.gz
chromium_src-790788ac7de91db6f349a0ecd1c98fd240b73ca2.tar.bz2
Add support for basic extension automation through the Automation Proxy.
BUG=36171 TEST=none Review URL: http://codereview.chromium.org/1048002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43730 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation/automation_proxy.cc')
-rw-r--r--chrome/test/automation/automation_proxy.cc30
1 files changed, 23 insertions, 7 deletions
diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc
index 46fcc3b..04bc7ea 100644
--- a/chrome/test/automation/automation_proxy.cc
+++ b/chrome/test/automation/automation_proxy.cc
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <sstream>
-
#include "chrome/test/automation/automation_proxy.h"
+#include <sstream>
+
#include "base/basictypes.h"
#include "base/file_version_info.h"
#include "base/logging.h"
@@ -16,8 +16,10 @@
#include "chrome/test/automation/automation_constants.h"
#include "chrome/test/automation/automation_messages.h"
#include "chrome/test/automation/browser_proxy.h"
+#include "chrome/test/automation/extension_proxy.h"
#include "chrome/test/automation/tab_proxy.h"
#include "chrome/test/automation/window_proxy.h"
+#include <gtest/gtest.h>
#include "ipc/ipc_descriptors.h"
#if defined(OS_WIN)
// TODO(port): Enable when dialog_delegate is ported.
@@ -230,11 +232,25 @@ bool AutomationProxy::SavePackageShouldPromptUser(bool should_prompt) {
return Send(new AutomationMsg_SavePackageShouldPromptUser(0, should_prompt));
}
-bool AutomationProxy::InstallExtension(const FilePath& crx_file) {
- AutomationMsg_ExtensionResponseValues response;
- if (!Send(new AutomationMsg_InstallExtension(0, crx_file, &response)))
- return false;
- return response == AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED;
+scoped_refptr<ExtensionProxy> AutomationProxy::InstallExtension(
+ const FilePath& crx_file) {
+ int handle = 0;
+ if (!Send(new AutomationMsg_InstallExtensionAndGetHandle(0, crx_file,
+ &handle)))
+ return NULL;
+
+ return ProxyObjectFromHandle<ExtensionProxy>(handle);
+}
+
+void AutomationProxy::EnsureExtensionTestResult() {
+ bool result;
+ std::string message;
+ if (!Send(new AutomationMsg_WaitForExtensionTestResult(0, &result,
+ &message))) {
+ FAIL() << "Could not send WaitForExtensionTestResult message";
+ return;
+ }
+ ASSERT_TRUE(result) << "Extension test message: " << message;
}
bool AutomationProxy::GetEnabledExtensions(