#include "base/test/scoped_run_loop_timeout.h"
#include <optional>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base::test {
namespace {
bool g_add_gtest_failure_on_timeout = …;
std::unique_ptr<ScopedRunLoopTimeout::TimeoutCallback>
g_handle_timeout_for_testing = …;
std::string TimeoutMessage(const RepeatingCallback<std::string()>& get_log,
const Location& timeout_enabled_from_here) { … }
void StandardTimeoutCallback(const Location& timeout_enabled_from_here,
RepeatingCallback<std::string()> on_timeout_log,
const Location& run_from_here) { … }
void TimeoutCallbackWithGtestFailure(
const Location& timeout_enabled_from_here,
RepeatingCallback<std::string()> on_timeout_log,
const Location& run_from_here) { … }
}
ScopedRunLoopTimeout::ScopedRunLoopTimeout(const Location& from_here,
TimeDelta timeout)
: … { … }
ScopedRunLoopTimeout::~ScopedRunLoopTimeout() { … }
ScopedRunLoopTimeout::ScopedRunLoopTimeout(
const Location& timeout_enabled_from_here,
std::optional<TimeDelta> timeout,
RepeatingCallback<std::string()> on_timeout_log)
: … { … }
ScopedRunLoopTimeout::TimeoutCallback
ScopedRunLoopTimeout::GetTimeoutCallback() { … }
bool ScopedRunLoopTimeout::ExistsForCurrentThread() { … }
void ScopedRunLoopTimeout::SetAddGTestFailureOnTimeout() { … }
const RunLoop::RunLoopTimeout*
ScopedRunLoopTimeout::GetTimeoutForCurrentThread() { … }
void ScopedRunLoopTimeout::SetTimeoutCallbackForTesting(
std::unique_ptr<ScopedRunLoopTimeout::TimeoutCallback> cb) { … }
ScopedDisableRunLoopTimeout::ScopedDisableRunLoopTimeout()
: … { … }
ScopedDisableRunLoopTimeout::~ScopedDisableRunLoopTimeout() { … }
}