summaryrefslogtreecommitdiffstats
path: root/webkit/support/webkit_support.cc
diff options
context:
space:
mode:
authortony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-29 21:07:38 +0000
committertony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-29 21:07:38 +0000
commit9683c5a97a9a4a8ab48f92c2b9b07136e4fa930c (patch)
tree957d756641cbf40589f662b9c1d665db17d15528 /webkit/support/webkit_support.cc
parent403b7a18a2dab29aa5ad3558ecb1c28fffb8514c (diff)
downloadchromium_src-9683c5a97a9a4a8ab48f92c2b9b07136e4fa930c.zip
chromium_src-9683c5a97a9a4a8ab48f92c2b9b07136e4fa930c.tar.gz
chromium_src-9683c5a97a9a4a8ab48f92c2b9b07136e4fa930c.tar.bz2
Properly crash when triggering an ASSERT() in debug DRT.
We would just print the stack trace and keep running. In webkit_unit_tests, we would print the stack trace and crash. Reverse the logic so in unit_tests, we keep going and in DRT, we crash. When rolling this into WebKit, we'll need to coordinate with the gardener since tests will start crashing on the debug bot. BUG=None Review URL: https://chromiumcodereview.appspot.com/9863056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129689 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/support/webkit_support.cc')
-rw-r--r--webkit/support/webkit_support.cc15
1 files changed, 7 insertions, 8 deletions
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 2898ab0..0f2ee69 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -90,14 +90,11 @@ void UnitTestAssertHandler(const std::string& str) {
FAIL() << str;
}
-void InitLogging(bool enable_gp_fault_error_box) {
- logging::SetLogAssertHandler(UnitTestAssertHandler);
-
+void InitLogging() {
#if defined(OS_WIN)
if (!::IsDebuggerPresent()) {
- UINT new_flags = SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX;
- if (!enable_gp_fault_error_box)
- new_flags |= SEM_NOGPFAULTERRORBOX;
+ UINT new_flags = SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
+ | SEM_NOGPFAULTERRORBOX;
// Preserve existing error mode, as discussed at
// http://blogs.msdn.com/oldnewthing/archive/2004/07/27/198410.aspx
@@ -138,10 +135,12 @@ class TestEnvironment {
TestEnvironment(bool unit_test_mode,
base::AtExitManager* existing_at_exit_manager) {
- if (!unit_test_mode) {
+ if (unit_test_mode) {
+ logging::SetLogAssertHandler(UnitTestAssertHandler);
+ } else {
// The existing_at_exit_manager must be not NULL.
at_exit_manager_.reset(existing_at_exit_manager);
- InitLogging(false);
+ InitLogging();
}
main_message_loop_.reset(new MessageLoopType);
// TestWebKitPlatformSupport must be instantiated after MessageLoopType.