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

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

Issue 7523060: Let pyauto create an attached webdriver instance to manipulate web pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move bools into struct Created 9 years, 5 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
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..7964326bb2196295ee49273b1bd42b79a9c3c925 100644
--- a/chrome/test/automation/proxy_launcher.cc
+++ b/chrome/test/automation/proxy_launcher.cc
@@ -504,11 +504,11 @@ base::TimeDelta ProxyLauncher::browser_quit_time() const {
// NamedProxyLauncher functions
NamedProxyLauncher::NamedProxyLauncher(const std::string& channel_id,
- bool launch_browser,
- bool disconnect_on_failure)
+ const InitParams& params)
: channel_id_(channel_id),
- launch_browser_(launch_browser),
- disconnect_on_failure_(disconnect_on_failure) {
+ launch_browser_(params.launch_browser),
+ disconnect_on_failure_(params.disconnect_on_failure),
+ wait_for_server_channel_(params.wait_for_server_channel) {
}
AutomationProxy* NamedProxyLauncher::CreateAutomationProxy(
@@ -542,19 +542,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)) {

Powered by Google App Engine
This is Rietveld 408576698