#include <fcntl.h>
#include <unistd.h>
#include <memory>
#include <string>
#include <utility>
#include "absl/cleanup/cleanup.h"
#include "absl/memory/memory.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/io/quic_default_event_loop.h"
#include "quiche/quic/core/io/quic_event_loop.h"
#include "quiche/quic/core/quic_alarm.h"
#include "quiche/quic/core/quic_alarm_factory.h"
#include "quiche/quic/core/quic_default_clock.h"
#include "quiche/quic/core/quic_time.h"
#include "quiche/quic/platform/api/quic_test.h"
#include "quiche/quic/test_tools/quic_test_utils.h"
namespace quic::test {
namespace {
_;
AtMost;
MATCHER_P(HasFlagSet, value, "Checks a flag in a bit mask") { … }
constexpr QuicSocketEventMask kAllEvents = …;
class MockQuicSocketEventListener : public QuicSocketEventListener { … };
class MockDelegate : public QuicAlarm::Delegate { … };
void SetNonBlocking(int fd) { … }
class QuicEventLoopFactoryTest
: public QuicTestWithParam<QuicEventLoopFactory*> { … };
std::string GetTestParamName(
::testing::TestParamInfo<QuicEventLoopFactory*> info) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(QuicEventLoopFactoryTest, NothingHappens) { … }
TEST_P(QuicEventLoopFactoryTest, RearmWriter) { … }
TEST_P(QuicEventLoopFactoryTest, Readable) { … }
TEST_P(QuicEventLoopFactoryTest, ArtificialNotifyFromCallback) { … }
TEST_P(QuicEventLoopFactoryTest, ArtificialNotifyOncePerIteration) { … }
TEST_P(QuicEventLoopFactoryTest, WriterUnblocked) { … }
TEST_P(QuicEventLoopFactoryTest, ArtificialEvent) { … }
TEST_P(QuicEventLoopFactoryTest, Unregister) { … }
TEST_P(QuicEventLoopFactoryTest, UnregisterInsideEventHandler) { … }
TEST_P(QuicEventLoopFactoryTest, UnregisterSelfInsideEventHandler) { … }
TEST_P(QuicEventLoopFactoryTest, ReadWriteSocket) { … }
TEST_P(QuicEventLoopFactoryTest, AlarmInFuture) { … }
TEST_P(QuicEventLoopFactoryTest, AlarmsInPast) { … }
TEST_P(QuicEventLoopFactoryTest, AlarmCancelled) { … }
TEST_P(QuicEventLoopFactoryTest, AlarmCancelledAndSetAgain) { … }
TEST_P(QuicEventLoopFactoryTest, AlarmCancelsAnotherAlarm) { … }
TEST_P(QuicEventLoopFactoryTest, DestructorWithPendingAlarm) { … }
TEST_P(QuicEventLoopFactoryTest, NegativeTimeout) { … }
TEST_P(QuicEventLoopFactoryTest, ScheduleAlarmInPastFromInsideAlarm) { … }
}
}