Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5305)

Unified Diff: chrome/test/automation/automation_proxy.cc

Issue 6685099: Removing command_execution_timeout_ms in favor of action_max_timeout_ms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/automation/automation_proxy.h ('k') | chrome/test/automation/browser_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/automation_proxy.cc
===================================================================
--- chrome/test/automation/automation_proxy.cc (revision 80714)
+++ chrome/test/automation/automation_proxy.cc (working copy)
@@ -90,7 +90,7 @@
} // anonymous namespace
-AutomationProxy::AutomationProxy(int command_execution_timeout_ms,
+AutomationProxy::AutomationProxy(int action_timeout_ms,
bool disconnect_on_failure)
: app_launched_(true, false),
initial_loads_complete_(true, false),
@@ -99,13 +99,13 @@
app_launch_signaled_(0),
perform_version_check_(false),
disconnect_on_failure_(disconnect_on_failure),
- command_execution_timeout_(
- TimeDelta::FromMilliseconds(command_execution_timeout_ms)),
+ action_timeout_(
+ TimeDelta::FromMilliseconds(action_timeout_ms)),
listener_thread_id_(0) {
// base::WaitableEvent::TimedWait() will choke if we give it a negative value.
// Zero also seems unreasonable, since we need to wait for IPC, but at
// least it is legal... ;-)
- DCHECK_GE(command_execution_timeout_ms, 0);
+ DCHECK_GE(action_timeout_ms, 0);
listener_thread_id_ = base::PlatformThread::CurrentId();
InitializeHandleTracker();
InitializeThread();
@@ -169,7 +169,7 @@
AutomationLaunchResult AutomationProxy::WaitForAppLaunch() {
AutomationLaunchResult result = AUTOMATION_SUCCESS;
- if (app_launched_.TimedWait(command_execution_timeout_)) {
+ if (app_launched_.TimedWait(action_timeout_)) {
if (perform_version_check_) {
// Obtain our own version number and compare it to what the automation
// provider sent.
@@ -209,11 +209,11 @@
}
bool AutomationProxy::WaitForInitialLoads() {
- return initial_loads_complete_.TimedWait(command_execution_timeout_);
+ return initial_loads_complete_.TimedWait(action_timeout_);
}
bool AutomationProxy::WaitForInitialNewTabUILoad(int* load_time) {
- if (new_tab_ui_load_complete_.TimedWait(command_execution_timeout_)) {
+ if (new_tab_ui_load_complete_.TimedWait(action_timeout_)) {
*load_time = new_tab_ui_load_time_;
new_tab_ui_load_complete_.Reset();
return true;
@@ -443,14 +443,18 @@
#endif // defined(OS_POSIX)
bool AutomationProxy::Send(IPC::Message* message) {
+ return Send(message,
+ static_cast<int>(action_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
@@ -549,9 +553,10 @@
}
bool AutomationProxy::SendJSONRequest(const std::string& request,
+ int timeout_ms,
std::string* response) {
bool result = false;
- if (!SendAutomationJSONRequest(this, request, response, &result))
+ if (!SendAutomationJSONRequest(this, request, timeout_ms, response, &result))
return false;
return result;
}
« no previous file with comments | « chrome/test/automation/automation_proxy.h ('k') | chrome/test/automation/browser_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698