#include "base/functional/callback.h"
#include <memory>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_internal.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/notreached.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "base/test/test_timeouts.h"
#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
void NopInvokeFunc() { … }
struct FakeBindState : internal::BindStateBase { … };
namespace {
class CallbackTest : public ::testing::Test { … };
TEST_F(CallbackTest, Types) { … }
TEST_F(CallbackTest, DefaultConstruction) { … }
TEST_F(CallbackTest, IsNull) { … }
TEST_F(CallbackTest, Equals) { … }
TEST_F(CallbackTest, Reset) { … }
TEST_F(CallbackTest, Move) { … }
TEST_F(CallbackTest, NullAfterMoveRun) { … }
TEST_F(CallbackTest, MaybeValidReturnsTrue) { … }
TEST_F(CallbackTest, ThenResetsOriginalCallback) { … }
TEST_F(CallbackTest, ThenCanConvertRepeatingToOnce) { … }
TEST_F(CallbackTest, ThenWithCompatibleButNotSameType) { … }
template <bool use_once, typename R, typename ThenR, typename... Args>
class CallbackThenTest;
CallbackThenTest<use_once, R (Args...), ThenR>;
CallbackThenOnceTest;
CallbackThenRepeatingTest;
TEST_F(CallbackTest, ThenOnce) { … }
TEST_F(CallbackTest, ThenRepeating) { … }
class ClassWithAMethod { … };
TEST_F(CallbackTest, MaybeValidInvalidateWeakPtrsOnSameSequence) { … }
TEST_F(CallbackTest, MaybeValidInvalidateWeakPtrsOnOtherSequence) { … }
TEST_F(CallbackTest, ThenAfterWeakPtr) { … }
class CallbackOwner : public base::RefCounted<CallbackOwner> { … };
TEST_F(CallbackTest, CallbackHasLastRefOnContainingObject) { … }
TEST(CallbackDeathTest, RunNullCallbackChecks) { … }
}
}