summaryrefslogtreecommitdiffstats
path: root/net/test/scoped_disable_exit_on_dfatal.cc
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-25 20:31:10 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-25 20:31:10 +0000
commitbe8cff83b5fdd35792ff5612043972182fa9c67d (patch)
tree5d248e488e15fea31969878bc40c5ad5f72ba68f /net/test/scoped_disable_exit_on_dfatal.cc
parent8e89b03ada36070a5f22791ff51a23539b471798 (diff)
downloadchromium_src-be8cff83b5fdd35792ff5612043972182fa9c67d.zip
chromium_src-be8cff83b5fdd35792ff5612043972182fa9c67d.tar.gz
chromium_src-be8cff83b5fdd35792ff5612043972182fa9c67d.tar.bz2
Use EXPECT_DFATAL instead of EXPECT_DEBUG_DEATH in spdy_protocol_test.cc.
Switch the associated DCHECK to a LOG_IF(DFATAL). Move EXPECT_DFATAL, and friends, from net/quic/test_tools/ to net/test/. Merge internal change: 60170975 Review URL: https://codereview.chromium.org/134193004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/test/scoped_disable_exit_on_dfatal.cc')
-rw-r--r--net/test/scoped_disable_exit_on_dfatal.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/net/test/scoped_disable_exit_on_dfatal.cc b/net/test/scoped_disable_exit_on_dfatal.cc
new file mode 100644
index 0000000..f909126
--- /dev/null
+++ b/net/test/scoped_disable_exit_on_dfatal.cc
@@ -0,0 +1,33 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/test/scoped_disable_exit_on_dfatal.h"
+
+#include "base/logging.h"
+
+namespace net {
+namespace test {
+
+// static
+ScopedDisableExitOnDFatal* ScopedDisableExitOnDFatal::g_instance_ = NULL;
+
+ScopedDisableExitOnDFatal::ScopedDisableExitOnDFatal() {
+ CHECK(!g_instance_);
+ g_instance_ = this;
+ logging::SetLogAssertHandler(LogAssertHandler);
+}
+
+ScopedDisableExitOnDFatal::~ScopedDisableExitOnDFatal() {
+ CHECK_EQ(g_instance_, this);
+ logging::SetLogAssertHandler(NULL);
+ g_instance_ = NULL;
+}
+
+// static
+void ScopedDisableExitOnDFatal::LogAssertHandler(const std::string& str) {
+ // Simply swallow the assert.
+}
+
+} // namespace test
+} // namespace net