Index: chrome/test/automation/proxy_launcher.cc |
diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc |
index 69742aa178fdee05d3730f0ab5cc8c7a2ef67b3c..c7aa01ff48930de3d9fed908d076ed1f35427c54 100644 |
--- a/chrome/test/automation/proxy_launcher.cc |
+++ b/chrome/test/automation/proxy_launcher.cc |
@@ -505,9 +505,11 @@ base::TimeDelta ProxyLauncher::browser_quit_time() const { |
NamedProxyLauncher::NamedProxyLauncher(const std::string& channel_id, |
bool launch_browser, |
+ bool wait_for_server_channel, |
bool disconnect_on_failure) |
: channel_id_(channel_id), |
launch_browser_(launch_browser), |
+ wait_for_server_channel_(wait_for_server_channel), |
disconnect_on_failure_(disconnect_on_failure) { |
} |
@@ -542,19 +544,21 @@ bool NamedProxyLauncher::InitializeConnection(const LaunchState& state, |
} |
} |
- // Wait for browser to be ready for connections. |
- bool testing_channel_exists = false; |
- for (int wait_time = 0; |
- wait_time < TestTimeouts::action_max_timeout_ms(); |
- wait_time += automation::kSleepTime) { |
- testing_channel_exists = file_util::PathExists(testing_channel_path); |
- if (testing_channel_exists) |
- break; |
- base::PlatformThread::Sleep(automation::kSleepTime); |
- } |
- if (!testing_channel_exists) { |
- LOG(ERROR) << "Failed to wait for testing channel presence."; |
- return false; |
+ if (wait_for_server_channel_) { |
+ // Wait for browser to be ready for connections. |
+ bool testing_channel_exists = false; |
+ for (int wait_time = 0; |
+ wait_time < TestTimeouts::action_max_timeout_ms(); |
+ wait_time += automation::kSleepTime) { |
+ testing_channel_exists = file_util::PathExists(testing_channel_path); |
+ if (testing_channel_exists) |
+ break; |
+ base::PlatformThread::Sleep(automation::kSleepTime); |
+ } |
+ if (!testing_channel_exists) { |
+ LOG(ERROR) << "Failed to wait for testing channel presence."; |
+ return false; |
+ } |
} |
if (!ConnectToRunningBrowser(wait_for_initial_loads)) { |