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 |
11 | 11 |
12 #include <iostream> | 12 #include <iostream> |
13 #include <fstream> | 13 #include <fstream> |
14 | 14 |
15 #include "base/at_exit.h" | 15 #include "base/at_exit.h" |
16 #include "base/base_paths.h" | 16 #include "base/base_paths.h" |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "base/file_path.h" | 18 #include "base/file_path.h" |
19 #include "base/file_util.h" | 19 #include "base/file_util.h" |
20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
21 #include "base/path_service.h" | 21 #include "base/path_service.h" |
| 22 #include "base/process_util.h" |
22 #include "base/stringprintf.h" | 23 #include "base/stringprintf.h" |
23 #include "base/string_number_conversions.h" | 24 #include "base/string_number_conversions.h" |
24 #include "base/string_split.h" | 25 #include "base/string_split.h" |
25 #include "base/string_util.h" | 26 #include "base/string_util.h" |
26 #include "base/synchronization/waitable_event.h" | 27 #include "base/synchronization/waitable_event.h" |
27 #include "base/test/test_timeouts.h" | 28 #include "base/test/test_timeouts.h" |
28 #include "base/threading/platform_thread.h" | 29 #include "base/threading/platform_thread.h" |
29 #include "base/time.h" | 30 #include "base/time.h" |
30 #include "base/utf_string_conversions.h" | 31 #include "base/utf_string_conversions.h" |
31 #include "chrome/common/chrome_constants.h" | 32 #include "chrome/common/chrome_constants.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 } | 220 } |
220 | 221 |
221 } // namespace | 222 } // namespace |
222 | 223 |
223 int RunChromeDriver() { | 224 int RunChromeDriver() { |
224 base::AtExitManager exit; | 225 base::AtExitManager exit; |
225 base::WaitableEvent shutdown_event(false, false); | 226 base::WaitableEvent shutdown_event(false, false); |
226 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); | 227 CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
227 | 228 |
228 #if defined(OS_POSIX) | 229 #if defined(OS_POSIX) |
229 signal(SIGPIPE, SIG_IGN); | 230 if (!IgnoreSigPipe()) { |
230 #endif | 231 LOG(ERROR) << "Failed to ignore SIGPIPE"; |
| 232 return EXIT_FAILURE; |
| 233 } |
| 234 #endif // defined(OS_POSIX) |
231 srand((unsigned int)time(NULL)); | 235 srand((unsigned int)time(NULL)); |
232 | 236 |
233 // Register Chrome's path provider so that the AutomationProxy will find our | 237 // Register Chrome's path provider so that the AutomationProxy will find our |
234 // built Chrome. | 238 // built Chrome. |
235 chrome::RegisterPathProvider(); | 239 chrome::RegisterPathProvider(); |
236 TestTimeouts::Initialize(); | 240 TestTimeouts::Initialize(); |
237 | 241 |
238 // Parse command line flags. | 242 // Parse command line flags. |
239 std::string port = "9515"; | 243 std::string port = "9515"; |
240 FilePath log_path; | 244 FilePath log_path; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 327 |
324 return (EXIT_SUCCESS); | 328 return (EXIT_SUCCESS); |
325 } | 329 } |
326 | 330 |
327 } // namespace webdriver | 331 } // namespace webdriver |
328 | 332 |
329 int main(int argc, char *argv[]) { | 333 int main(int argc, char *argv[]) { |
330 CommandLine::Init(argc, argv); | 334 CommandLine::Init(argc, argv); |
331 return webdriver::RunChromeDriver(); | 335 return webdriver::RunChromeDriver(); |
332 } | 336 } |
OLD | NEW |