#include "base/message_loop/message_pump_epoll.h"
#include <fcntl.h>
#include <sys/socket.h>
#include <unistd.h>
#include <memory>
#include <string_view>
#include <utility>
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/raw_ref.h"
#include "base/message_loop/message_pump_type.h"
#include "base/posix/eintr_wrapper.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
#include "base/synchronization/waitable_event_watcher.h"
#include "base/task/current_thread.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_executor.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/gtest_util.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/threading/thread.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
class MessagePumpEpollTest : public testing::Test { … };
namespace {
class StupidWatcher : public MessagePumpEpoll::FdWatcher { … };
TEST_F(MessagePumpEpollTest, QuitOutsideOfRun) { … }
class BaseWatcher : public MessagePumpEpoll::FdWatcher { … };
class DeleteWatcher : public BaseWatcher { … };
TEST_F(MessagePumpEpollTest, DeleteWatcher) { … }
class StopWatcher : public BaseWatcher { … };
TEST_F(MessagePumpEpollTest, StopWatcher) { … }
void QuitMessageLoopAndStart(OnceClosure quit_closure) { … }
class NestedPumpWatcher : public MessagePumpEpoll::FdWatcher { … };
TEST_F(MessagePumpEpollTest, NestedPumpWatcher) { … }
void FatalClosure() { … }
class QuitWatcher : public BaseWatcher { … };
void WriteFDWrapper(const int fd,
const char* buf,
int size,
WaitableEvent* event) { … }
TEST_F(MessagePumpEpollTest, QuitWatcher) { … }
class InnerNestedWatcher : public MessagePumpEpoll::FdWatcher { … };
class OuterNestedWatcher : public MessagePumpEpoll::FdWatcher { … };
TEST_F(MessagePumpEpollTest, NestedNotification) { … }
class RepeatWatcher : public BaseWatcher { … };
void RepeatEventTest(bool persistent,
int repeat,
std::unique_ptr<MessagePumpEpoll> executor_pump,
int sender,
int receiver) { … }
TEST_F(MessagePumpEpollTest, RepeatPersistentEvent) { … }
TEST_F(MessagePumpEpollTest, RepeatOneShotEvent) { … }
}
}