diff options
author | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 22:35:10 +0000 |
---|---|---|
committer | erikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-13 22:35:10 +0000 |
commit | 302831b6e4e9d8a700ecbea7616f1879898bbfb9 (patch) | |
tree | 1325149eae7db9f1a302801d275ae9761b1aebf1 /chrome/common/ipc_tests.cc | |
parent | d3f6b195024afbf311e9eff816ebe17d853d9ab8 (diff) | |
download | chromium_src-302831b6e4e9d8a700ecbea7616f1879898bbfb9.zip chromium_src-302831b6e4e9d8a700ecbea7616f1879898bbfb9.tar.gz chromium_src-302831b6e4e9d8a700ecbea7616f1879898bbfb9.tar.bz2 |
Call logging::InitLogging. The lack of this was causing some hangs (and possibly crashes) in ObserverListTest.BUG=6286
This CL has expanded to include some cleanup and refactoring of test_suite and related files, so that this logging change (and other improvements) are applied to all unit tests.
Review URL: http://codereview.chromium.org/18003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7977 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_tests.cc')
-rw-r--r-- | chrome/common/ipc_tests.cc | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/chrome/common/ipc_tests.cc b/chrome/common/ipc_tests.cc index ffa7109..be3b0d9 100644 --- a/chrome/common/ipc_tests.cc +++ b/chrome/common/ipc_tests.cc @@ -16,8 +16,7 @@ #include "base/command_line.h" #include "base/debug_on_start.h" #include "base/perftimer.h" -#include "base/process_util.h" -#include "base/scoped_nsautorelease_pool.h" +#include "base/perf_test_suite.h" #include "base/test_suite.h" #include "base/thread.h" #include "chrome/common/chrome_switches.h" @@ -435,41 +434,11 @@ MULTIPROCESS_TEST_MAIN(RunReflector) { #endif // PERFORMANCE_TEST -#if defined(OS_WIN) -// All fatal log messages (e.g. DCHECK failures) imply unit test failures -static void IPCTestAssertHandler(const std::string& str) { - FAIL() << str; -} - -// Disable crash dialogs so that it doesn't gum up the buildbot -static void SuppressErrorDialogs() { - UINT new_flags = SEM_FAILCRITICALERRORS | - SEM_NOGPFAULTERRORBOX | - SEM_NOOPENFILEERRORBOX; - - // Preserve existing error mode, as discussed at http://t/dmea - UINT existing_flags = SetErrorMode(new_flags); - SetErrorMode(existing_flags | new_flags); -} -#endif // defined(OS_WIN) - int main(int argc, char** argv) { - base::ScopedNSAutoreleasePool scoped_pool; - base::EnableTerminationOnHeapCorruption(); - -#if defined(OS_WIN) - // suppress standard crash dialogs and such unless a debugger is present. - if (!IsDebuggerPresent()) { - SuppressErrorDialogs(); - logging::SetLogAssertHandler(IPCTestAssertHandler); - } -#endif // defined(OS_WIN) - - int retval = TestSuite(argc, argv).Run(); - #ifdef PERFORMANCE_TEST - if (!InitPerfLog("ipc_perf_child.log")) - return 1; + int retval = PerfTestSuite(argc, argv).Run(); +#else + int retval = TestSuite(argc, argv).Run(); #endif return retval; } |