#include "base/threading/thread.h"
#include <stddef.h>
#include <stdint.h>
#include <utility>
#include <vector>
#include "base/dcheck_is_on.h"
#include "base/debug/leak_annotations.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/task/current_thread.h"
#include "base/task/sequence_manager/sequence_manager_impl.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#include "third_party/abseil-cpp/absl/base/dynamic_annotations.h"
#if DCHECK_IS_ON()
#include "base/threading/thread_restrictions.h"
#endif
NotNull;
ThreadTest;
namespace base {
namespace {
void ToggleValue(bool* value) { … }
class SleepInsideInitThread : public Thread { … };
enum ThreadEvent { … };
EventList;
class CaptureToEventList : public Thread { … };
class CapturingDestructionObserver : public CurrentThread::DestructionObserver { … };
void RegisterDestructionObserver(CurrentThread::DestructionObserver* observer) { … }
void ReturnThreadId(Thread* thread,
PlatformThreadId* id,
WaitableEvent* event) { … }
}
TEST_F(ThreadTest, StartWithOptions_StackSize) { … }
#if !defined(THREAD_SANITIZER)
TEST_F(ThreadTest, StartWithOptions_NonJoinable) { … }
#endif
TEST_F(ThreadTest, TwoTasksOnJoinableThread) { … }
TEST_F(ThreadTest, DestroyWhileRunningIsSafe) { … }
TEST_F(ThreadTest, DISABLED_DestroyWhileRunningNonJoinableIsSafe) { … }
TEST_F(ThreadTest, StopSoon) { … }
TEST_F(ThreadTest, StopTwiceNop) { … }
TEST_F(ThreadTest, DISABLED_StopOnNonOwningThreadIsDeath) { … }
TEST_F(ThreadTest, TransferOwnershipAndStop) { … }
TEST_F(ThreadTest, StartTwice) { … }
#if !defined(THREAD_SANITIZER)
TEST_F(ThreadTest, StartTwiceNonJoinableNotAllowed) { … }
#endif
TEST_F(ThreadTest, ThreadName) { … }
TEST_F(ThreadTest, ThreadId) { … }
TEST_F(ThreadTest, ThreadIdWithRestart) { … }
TEST_F(ThreadTest, SleepInsideInit) { … }
TEST_F(ThreadTest, CleanUp) { … }
TEST_F(ThreadTest, ThreadNotStarted) { … }
TEST_F(ThreadTest, MultipleWaitUntilThreadStarted) { … }
TEST_F(ThreadTest, FlushForTesting) { … }
namespace {
TaskQueue;
class SequenceManagerThreadDelegate : public Thread::Delegate { … };
}
TEST_F(ThreadTest, ProvidedThreadDelegate) { … }
}