diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 13:10:22 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-01 13:10:22 +0000 |
commit | d81baca47b9f03e3cc50053e163dcd2be8ce7deb (patch) | |
tree | e61198793a5cad972af07a853f383c8f49daf823 /base/test | |
parent | b294bc636677a5b83307f892674f81c20ff080c5 (diff) | |
download | chromium_src-d81baca47b9f03e3cc50053e163dcd2be8ce7deb.zip chromium_src-d81baca47b9f03e3cc50053e163dcd2be8ce7deb.tar.gz chromium_src-d81baca47b9f03e3cc50053e163dcd2be8ce7deb.tar.bz2 |
linux: use xmessage for the dialog used in LOG(FATAL)
The previous code printed to stderr, but since the logging code
already had logged to stderr we'd end up printing the message twice,
which was making me nervous.
BUG=29997,31243,37026
Review URL: http://codereview.chromium.org/660269
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40271 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test')
-rw-r--r-- | base/test/test_suite.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/base/test/test_suite.h b/base/test/test_suite.h index 94e7b1a..a8dfdeb 100644 --- a/base/test/test_suite.h +++ b/base/test/test_suite.h @@ -12,6 +12,7 @@ #include "base/at_exit.h" #include "base/base_paths.h" #include "base/debug_on_start.h" +#include "base/debug_util.h" #include "base/i18n/icu_util.h" #include "base/multiprocess_test.h" #include "base/nss_util.h" @@ -146,12 +147,11 @@ class TestSuite { } protected: -#if defined(OS_WIN) - // TODO(phajdan.jr): Clean up the windows-specific hacks. + // TODO(phajdan.jr): Clean this up. // See http://crbug.com/29997 // By default, base::LogMessage::~LogMessage calls DebugUtil::BreakDebugger() - // when severity is LOG_FATAL. On Windows, this results in error dialogs + // when severity is LOG_FATAL. This results in error dialogs // which are not friendly to buildbots. // To avoid these problems, we override the LogMessage behaviour by // replacing the assert handler with UnitTestAssertHandler. @@ -164,6 +164,7 @@ class TestSuite { // Disable crash dialogs so that it doesn't gum up the buildbot virtual void SuppressErrorDialogs() { +#if defined(OS_WIN) UINT new_flags = SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX; @@ -172,8 +173,8 @@ class TestSuite { // http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx UINT existing_flags = SetErrorMode(new_flags); SetErrorMode(existing_flags | new_flags); - } #endif // defined(OS_WIN) + } // Override these for custom initialization and shutdown handling. Use these // instead of putting complex code in your constructor/destructor. @@ -197,18 +198,14 @@ class TestSuite { // between production code and test code. bool result = base::Time::UseHighResolutionTimer(true); CHECK(result); +#endif // defined(OS_WIN) // In some cases, we do not want to see standard error dialogs. - if (!IsDebuggerPresent() && + if (!DebugUtil::BeingDebugged() && !CommandLine::ForCurrentProcess()->HasSwitch("show-error-dialogs")) { SuppressErrorDialogs(); -#if !defined(PURIFY) - // When the code in this file moved around, bug 6436 resurfaced. - // As a hack workaround, just #ifdef out this code for Purify builds. logging::SetLogAssertHandler(UnitTestAssertHandler); -#endif // !defined(PURIFY) } -#endif // defined(OS_WIN) icu_util::Initialize(); |