#include "base/one_shot_event.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/test/test_simple_task_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
void Increment(int* i) { … }
class RefCountedClass : public base::RefCounted<RefCountedClass> { … };
TEST(OneShotEventTest, RecordsSignal) { … }
TEST(OneShotEventTest, CallsQueueAsDistinctTask) { … }
TEST(OneShotEventTest, CallsQueue) { … }
TEST(OneShotEventTest, CallsAfterSignalDontRunInline) { … }
TEST(OneShotEventTest, PostDefaultsToCurrentMessageLoop) { … }
void CheckSignaledAndPostIncrement(
OneShotEvent* event,
const scoped_refptr<base::SingleThreadTaskRunner>& runner,
int* i) { … }
TEST(OneShotEventTest, IsSignaledAndPostsFromCallbackWork) { … }
TEST(OneShotEventTest, DropsCallbackRefUponSignalled) { … }
}