Chromium Code Reviews| 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" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 #include "testing/gtest/include/gtest/gtest.h" | 33 #include "testing/gtest/include/gtest/gtest.h" |
| 34 #include "testing/multiprocess_func_list.h" | 34 #include "testing/multiprocess_func_list.h" |
| 35 | 35 |
| 36 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
| 37 #include "base/mac/scoped_nsautorelease_pool.h" | 37 #include "base/mac/scoped_nsautorelease_pool.h" |
| 38 #if defined(OS_IOS) | 38 #if defined(OS_IOS) |
| 39 #include "base/test/test_listener_ios.h" | 39 #include "base/test/test_listener_ios.h" |
| 40 #endif // OS_IOS | 40 #endif // OS_IOS |
| 41 #endif // OS_MACOSX | 41 #endif // OS_MACOSX |
| 42 | 42 |
| 43 #if !defined(OS_WIN) | 43 #if defined(OS_WIN) |
| 44 #include "base/debug/close_handle_hook_win.h" | |
| 45 #include "base/win/windows_version.h" | |
| 46 #else | |
| 44 #include "base/i18n/rtl.h" | 47 #include "base/i18n/rtl.h" |
| 45 #if !defined(OS_IOS) | 48 #if !defined(OS_IOS) |
| 46 #include "base/strings/string_util.h" | 49 #include "base/strings/string_util.h" |
| 47 #include "third_party/icu/source/common/unicode/uloc.h" | 50 #include "third_party/icu/source/common/unicode/uloc.h" |
| 48 #endif | 51 #endif |
| 49 #endif | 52 #endif |
| 50 | 53 |
| 51 #if defined(OS_ANDROID) | 54 #if defined(OS_ANDROID) |
| 52 #include "base/test/test_support_android.h" | 55 #include "base/test/test_support_android.h" |
| 53 #endif | 56 #endif |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 settings.log_file = log_filename.value().c_str(); | 313 settings.log_file = log_filename.value().c_str(); |
| 311 settings.delete_old = logging::DELETE_OLD_LOG_FILE; | 314 settings.delete_old = logging::DELETE_OLD_LOG_FILE; |
| 312 logging::InitLogging(settings); | 315 logging::InitLogging(settings); |
| 313 // We want process and thread IDs because we may have multiple processes. | 316 // We want process and thread IDs because we may have multiple processes. |
| 314 // Note: temporarily enabled timestamps in an effort to catch bug 6361. | 317 // Note: temporarily enabled timestamps in an effort to catch bug 6361. |
| 315 logging::SetLogItems(true, true, true, true); | 318 logging::SetLogItems(true, true, true, true); |
| 316 #endif // else defined(OS_ANDROID) | 319 #endif // else defined(OS_ANDROID) |
| 317 | 320 |
| 318 CHECK(debug::EnableInProcessStackDumping()); | 321 CHECK(debug::EnableInProcessStackDumping()); |
| 319 #if defined(OS_WIN) | 322 #if defined(OS_WIN) |
| 323 #if defined(_DEBUG) | |
|
scottmg
2016/02/01 16:45:31
It's sort of weird that sometimes it's disabled he
Will Harris
2016/02/01 19:16:12
Done.
Another option is expose something like bas
| |
| 324 // Handle hooks cause shutdown asserts in Debug on Windows 7. crbug.com/571304 | |
| 325 if (base::win::GetVersion() >= base::win::VERSION_WIN8) | |
| 326 base::debug::InstallHandleHooks(); | |
| 327 #else | |
| 328 base::debug::InstallHandleHooks(); | |
| 329 #endif | |
| 330 | |
| 320 RouteStdioToConsole(true); | 331 RouteStdioToConsole(true); |
| 321 // Make sure we run with high resolution timer to minimize differences | 332 // Make sure we run with high resolution timer to minimize differences |
| 322 // between production code and test code. | 333 // between production code and test code. |
| 323 Time::EnableHighResolutionTimer(true); | 334 Time::EnableHighResolutionTimer(true); |
| 324 #endif // defined(OS_WIN) | 335 #endif // defined(OS_WIN) |
| 325 | 336 |
| 326 // In some cases, we do not want to see standard error dialogs. | 337 // In some cases, we do not want to see standard error dialogs. |
| 327 if (!debug::BeingDebugged() && | 338 if (!debug::BeingDebugged() && |
| 328 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { | 339 !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { |
| 329 SuppressErrorDialogs(); | 340 SuppressErrorDialogs(); |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 355 | 366 |
| 356 TestTimeouts::Initialize(); | 367 TestTimeouts::Initialize(); |
| 357 | 368 |
| 358 trace_to_file_.BeginTracingFromCommandLineOptions(); | 369 trace_to_file_.BeginTracingFromCommandLineOptions(); |
| 359 } | 370 } |
| 360 | 371 |
| 361 void TestSuite::Shutdown() { | 372 void TestSuite::Shutdown() { |
| 362 } | 373 } |
| 363 | 374 |
| 364 } // namespace base | 375 } // namespace base |
| OLD | NEW |