OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <signal.h> | 5 #include <signal.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 | 7 |
8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 std::cerr << "Port already in use. Exiting..." << std::endl; | 298 std::cerr << "Port already in use. Exiting..." << std::endl; |
299 #if defined(OS_WIN) | 299 #if defined(OS_WIN) |
300 return WSAEADDRINUSE; | 300 return WSAEADDRINUSE; |
301 #else | 301 #else |
302 return EADDRINUSE; | 302 return EADDRINUSE; |
303 #endif | 303 #endif |
304 } | 304 } |
305 | 305 |
306 // The tests depend on parsing the first line ChromeDriver outputs, | 306 // The tests depend on parsing the first line ChromeDriver outputs, |
307 // so all other logging should happen after this. | 307 // so all other logging should happen after this. |
308 std::cout << "Started ChromeDriver" << std::endl | 308 if (!cmd_line->HasSwitch("silent")) { |
309 << "port=" << port << std::endl | 309 std::cout << "Started ChromeDriver" << std::endl |
310 << "version=" << chrome::kChromeVersion << std::endl; | 310 << "port=" << port << std::endl |
311 if (logging_success) | 311 << "version=" << chrome::kChromeVersion << std::endl; |
312 std::cout << "log=" << FileLog::Get()->path().value() << std::endl; | 312 if (logging_success) |
313 else | 313 std::cout << "log=" << FileLog::Get()->path().value() << std::endl; |
314 std::cout << "Log file could not be created" << std::endl; | 314 else |
| 315 std::cout << "Log file could not be created" << std::endl; |
| 316 } |
315 | 317 |
316 // Run until we receive command to shutdown. | 318 // Run until we receive command to shutdown. |
317 // Don't call mg_stop because mongoose will hang if clients are still | 319 // Don't call mg_stop because mongoose will hang if clients are still |
318 // connected when keep-alive is enabled. | 320 // connected when keep-alive is enabled. |
319 shutdown_event.Wait(); | 321 shutdown_event.Wait(); |
320 | 322 |
321 return (EXIT_SUCCESS); | 323 return (EXIT_SUCCESS); |
322 } | 324 } |
323 | 325 |
324 } // namespace webdriver | 326 } // namespace webdriver |
325 | 327 |
326 int main(int argc, char *argv[]) { | 328 int main(int argc, char *argv[]) { |
327 CommandLine::Init(argc, argv); | 329 CommandLine::Init(argc, argv); |
328 return webdriver::RunChromeDriver(); | 330 return webdriver::RunChromeDriver(); |
329 } | 331 } |
OLD | NEW |