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 "base/test/test_suite.h" | 5 #include "base/test/test_suite.h" |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/debug/debugger.h" | 12 #include "base/debug/debugger.h" |
13 #include "base/debug/stack_trace.h" | 13 #include "base/debug/stack_trace.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
16 #include "base/i18n/icu_util.h" | 16 #include "base/i18n/icu_util.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/process/launch.h" |
20 #include "base/process/memory.h" | 21 #include "base/process/memory.h" |
21 #include "base/test/gtest_xml_unittest_result_printer.h" | 22 #include "base/test/gtest_xml_unittest_result_printer.h" |
22 #include "base/test/gtest_xml_util.h" | 23 #include "base/test/gtest_xml_util.h" |
23 #include "base/test/launcher/unit_test_launcher.h" | 24 #include "base/test/launcher/unit_test_launcher.h" |
24 #include "base/test/multiprocess_test.h" | 25 #include "base/test/multiprocess_test.h" |
25 #include "base/test/test_switches.h" | 26 #include "base/test/test_switches.h" |
26 #include "base/test/test_timeouts.h" | 27 #include "base/test/test_timeouts.h" |
27 #include "base/time/time.h" | 28 #include "base/time/time.h" |
28 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" |
29 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 settings.log_file = log_filename.value().c_str(); | 306 settings.log_file = log_filename.value().c_str(); |
306 settings.delete_old = logging::DELETE_OLD_LOG_FILE; | 307 settings.delete_old = logging::DELETE_OLD_LOG_FILE; |
307 logging::InitLogging(settings); | 308 logging::InitLogging(settings); |
308 // We want process and thread IDs because we may have multiple processes. | 309 // We want process and thread IDs because we may have multiple processes. |
309 // Note: temporarily enabled timestamps in an effort to catch bug 6361. | 310 // Note: temporarily enabled timestamps in an effort to catch bug 6361. |
310 logging::SetLogItems(true, true, true, true); | 311 logging::SetLogItems(true, true, true, true); |
311 #endif // else defined(OS_ANDROID) | 312 #endif // else defined(OS_ANDROID) |
312 | 313 |
313 CHECK(debug::EnableInProcessStackDumping()); | 314 CHECK(debug::EnableInProcessStackDumping()); |
314 #if defined(OS_WIN) | 315 #if defined(OS_WIN) |
| 316 RouteStdioToConsole(true); |
315 // Make sure we run with high resolution timer to minimize differences | 317 // Make sure we run with high resolution timer to minimize differences |
316 // between production code and test code. | 318 // between production code and test code. |
317 Time::EnableHighResolutionTimer(true); | 319 Time::EnableHighResolutionTimer(true); |
318 #endif // defined(OS_WIN) | 320 #endif // defined(OS_WIN) |
319 | 321 |
320 // In some cases, we do not want to see standard error dialogs. | 322 // In some cases, we do not want to see standard error dialogs. |
321 if (!debug::BeingDebugged() && | 323 if (!debug::BeingDebugged() && |
322 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { | 324 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { |
323 SuppressErrorDialogs(); | 325 SuppressErrorDialogs(); |
324 debug::SetSuppressDebugUI(true); | 326 debug::SetSuppressDebugUI(true); |
(...skipping 24 matching lines...) Expand all Loading... |
349 | 351 |
350 TestTimeouts::Initialize(); | 352 TestTimeouts::Initialize(); |
351 | 353 |
352 trace_to_file_.BeginTracingFromCommandLineOptions(); | 354 trace_to_file_.BeginTracingFromCommandLineOptions(); |
353 } | 355 } |
354 | 356 |
355 void TestSuite::Shutdown() { | 357 void TestSuite::Shutdown() { |
356 } | 358 } |
357 | 359 |
358 } // namespace base | 360 } // namespace base |
OLD | NEW |