| Index: chrome/test/automation/automation_proxy.cc
|
| ===================================================================
|
| --- chrome/test/automation/automation_proxy.cc (revision 79305)
|
| +++ chrome/test/automation/automation_proxy.cc (working copy)
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -14,6 +14,7 @@
|
| #include "base/process_util.h"
|
| #include "base/ref_counted.h"
|
| #include "base/synchronization/waitable_event.h"
|
| +#include "base/test/test_timeouts.h"
|
| #include "chrome/common/automation_constants.h"
|
| #include "chrome/common/automation_messages.h"
|
| #include "chrome/common/chrome_version_info.h"
|
| @@ -448,14 +449,18 @@
|
| #endif // defined(OS_POSIX)
|
|
|
| bool AutomationProxy::Send(IPC::Message* message) {
|
| + return Send(message,
|
| + command_execution_timeout_.InMilliseconds());
|
| +}
|
| +
|
| +bool AutomationProxy::Send(IPC::Message* message, int timeout_ms) {
|
| if (!channel_.get()) {
|
| LOG(ERROR) << "Automation channel has been closed; dropping message!";
|
| delete message;
|
| return false;
|
| }
|
|
|
| - bool success = channel_->SendWithTimeout(message,
|
| - command_execution_timeout_ms());
|
| + bool success = channel_->SendWithTimeout(message, timeout_ms);
|
|
|
| if (!success && disconnect_on_failure_) {
|
| // Send failed (possibly due to a timeout). Browser is likely in a weird
|
| @@ -560,3 +565,11 @@
|
| return false;
|
| return result;
|
| }
|
| +
|
| +bool AutomationProxy::SendJSONRequest(const std::string& request,
|
| + std::string* response, int timeout) {
|
| + bool result = false;
|
| + if (!SendAutomationJSONRequest(this, request, response, &result, timeout))
|
| + return false;
|
| + return result;
|
| +}
|
|
|