| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/test/webdriver/session_manager.h" | 5 #include "chrome/test/webdriver/session_manager.h" |
| 6 | 6 |
| 7 #ifdef OS_POSIX | 7 #ifdef OS_POSIX |
| 8 #include <netdb.h> | 8 #include <netdb.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 #include <arpa/inet.h> | 10 #include <arpa/inet.h> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 *id = GenerateSessionID(); | 136 *id = GenerateSessionID(); |
| 137 if (map_.find(*id) != map_.end()) { | 137 if (map_.find(*id) != map_.end()) { |
| 138 LOG(ERROR) << "Failed to generate a unique session ID"; | 138 LOG(ERROR) << "Failed to generate a unique session ID"; |
| 139 return false; | 139 return false; |
| 140 } | 140 } |
| 141 | 141 |
| 142 // Init the commandline singleton from the env | 142 // Init the commandline singleton from the env |
| 143 CommandLine::Init(0, NULL); | 143 CommandLine::Init(0, NULL); |
| 144 | 144 |
| 145 // start chrome, if it doesn't startup in 8 seconds quit | 145 // start chrome, if it doesn't startup in 8 seconds quit |
| 146 scoped_ptr<Session> session(new Session(*id, new AutomationProxy(8000))); | 146 scoped_ptr<Session> session(new Session(*id, new AutomationProxy(8000, |
| 147 false))); |
| 147 if (session->proxy() == NULL) { | 148 if (session->proxy() == NULL) { |
| 148 LOG(WARNING) << "Could not allocate automation proxy" << std::endl; | 149 LOG(WARNING) << "Could not allocate automation proxy" << std::endl; |
| 149 return false; | 150 return false; |
| 150 } | 151 } |
| 151 | 152 |
| 152 #if defined(OS_POSIX) | 153 #if defined(OS_POSIX) |
| 153 char* user_data_dir = getenv("CHROME_UI_TESTS_USER_DATA_DIR"); | 154 char* user_data_dir = getenv("CHROME_UI_TESTS_USER_DATA_DIR"); |
| 154 if (user_data_dir) { | 155 if (user_data_dir) { |
| 155 browser_directory.Append(user_data_dir); | 156 browser_directory.Append(user_data_dir); |
| 156 } | 157 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 std::map<std::string, Session*>::const_iterator it; | 243 std::map<std::string, Session*>::const_iterator it; |
| 243 it = map_.find(id); | 244 it = map_.find(id); |
| 244 if (it == map_.end()) { | 245 if (it == map_.end()) { |
| 245 LOG(INFO) << "No such session with ID " << id; | 246 LOG(INFO) << "No such session with ID " << id; |
| 246 return NULL; | 247 return NULL; |
| 247 } | 248 } |
| 248 return it->second; | 249 return it->second; |
| 249 } | 250 } |
| 250 } // namespace webdriver | 251 } // namespace webdriver |
| 251 | 252 |
| OLD | NEW |