#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "base/files/file_descriptor_watcher_posix.h"
#include <unistd.h>
#include <memory>
#include "base/containers/span.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_pump_type.h"
#include "base/posix/eintr_wrapper.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "base/threading/thread.h"
#include "base/threading/thread_checker_impl.h"
#include "build/build_config.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
namespace {
class Mock { … };
enum class FileDescriptorWatcherTestType { … };
class FileDescriptorWatcherTest
: public testing::TestWithParam<FileDescriptorWatcherTestType> { … };
}
TEST_P(FileDescriptorWatcherTest, WatchWritable) { … }
TEST_P(FileDescriptorWatcherTest, WatchReadableOneByte) { … }
TEST_P(FileDescriptorWatcherTest, WatchReadableTwoBytes) { … }
TEST_P(FileDescriptorWatcherTest, WatchReadableByteWrittenFromCallback) { … }
TEST_P(FileDescriptorWatcherTest, DeleteControllerFromCallback) { … }
TEST_P(FileDescriptorWatcherTest,
DeleteControllerBeforeFileDescriptorReadable) { … }
TEST_P(FileDescriptorWatcherTest, DeleteControllerAfterFileDescriptorReadable) { … }
TEST_P(FileDescriptorWatcherTest, DeleteControllerAfterDeleteMessagePumpForIO) { … }
TEST_P(FileDescriptorWatcherTest,
WatchReadableOneByteAndWatchReadableTwoBytesOnFd2ClosedInTheMiddle) { … }
INSTANTIATE_TEST_SUITE_P(…);
INSTANTIATE_TEST_SUITE_P(…);
}