Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1061)

Unified Diff: net/test/scoped_disable_exit_on_dfatal.cc

Issue 2638763004: Report CHECK/DCHECK to test launcher summary output. (Closed)
Patch Set: Add test for assert handlers nesting. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/scoped_disable_exit_on_dfatal.h ('k') | net/tools/stress_cache/stress_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/scoped_disable_exit_on_dfatal.cc
diff --git a/net/test/scoped_disable_exit_on_dfatal.cc b/net/test/scoped_disable_exit_on_dfatal.cc
index f9091261bc56464288820ade1caeb3b90d0bad73..14821db8c389ab4e2300f057e955a1eb3f6f868d 100644
--- a/net/test/scoped_disable_exit_on_dfatal.cc
+++ b/net/test/scoped_disable_exit_on_dfatal.cc
@@ -4,28 +4,24 @@
#include "net/test/scoped_disable_exit_on_dfatal.h"
+#include "base/bind.h"
#include "base/logging.h"
+#include "base/strings/string_piece.h"
namespace net {
namespace test {
-// static
-ScopedDisableExitOnDFatal* ScopedDisableExitOnDFatal::g_instance_ = NULL;
-
-ScopedDisableExitOnDFatal::ScopedDisableExitOnDFatal() {
- CHECK(!g_instance_);
- g_instance_ = this;
- logging::SetLogAssertHandler(LogAssertHandler);
-}
+ScopedDisableExitOnDFatal::ScopedDisableExitOnDFatal()
+ : assert_handler_(base::Bind(LogAssertHandler)) {}
-ScopedDisableExitOnDFatal::~ScopedDisableExitOnDFatal() {
- CHECK_EQ(g_instance_, this);
- logging::SetLogAssertHandler(NULL);
- g_instance_ = NULL;
-}
+ScopedDisableExitOnDFatal::~ScopedDisableExitOnDFatal() {}
// static
-void ScopedDisableExitOnDFatal::LogAssertHandler(const std::string& str) {
+void ScopedDisableExitOnDFatal::LogAssertHandler(
+ const char* file,
+ int line,
+ const base::StringPiece message,
+ const base::StringPiece stack_trace) {
// Simply swallow the assert.
}
« no previous file with comments | « net/test/scoped_disable_exit_on_dfatal.h ('k') | net/tools/stress_cache/stress_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698