1 // Copyright 2014 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "net/test/scoped_disable_exit_on_dfatal.h" 6 7 #include <string_view> 8 9 #include "base/functional/bind.h" 10 #include "base/functional/callback.h" 11 #include "base/strings/string_piece.h" 12 13 namespace net::test { 14 ScopedDisableExitOnDFatal()15ScopedDisableExitOnDFatal::ScopedDisableExitOnDFatal() 16 : assert_handler_(base::BindRepeating(LogAssertHandler)) {} 17 18 ScopedDisableExitOnDFatal::~ScopedDisableExitOnDFatal() = default; 19 20 // static LogAssertHandler(const char * file,int line,const std::string_view message,const std::string_view stack_trace)21void ScopedDisableExitOnDFatal::LogAssertHandler( 22 const char* file, 23 int line, 24 const std::string_view message, 25 const std::string_view stack_trace) { 26 // Simply swallow the assert. 27 } 28 29 } // namespace net::test 30