#include "net/test/embedded_test_server/connection_tracker.h"
#include "base/containers/contains.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
bool GetPort(const net::StreamSocket& connection, uint16_t* port) { … }
}
namespace net::test_server {
ConnectionTracker::ConnectionTracker(EmbeddedTestServer* test_server)
: … { … }
ConnectionTracker::~ConnectionTracker() = default;
void ConnectionTracker::AcceptedSocketWithPort(uint16_t port) { … }
void ConnectionTracker::ReadFromSocketWithPort(uint16_t port) { … }
size_t ConnectionTracker::GetAcceptedSocketCount() const { … }
size_t ConnectionTracker::GetReadSocketCount() const { … }
void ConnectionTracker::WaitUntilConnectionRead() { … }
void ConnectionTracker::WaitForAcceptedConnections(size_t num_connections) { … }
void ConnectionTracker::CheckAccepted() { … }
void ConnectionTracker::ResetCounts() { … }
ConnectionTracker::ConnectionListener::ConnectionListener(
ConnectionTracker* tracker)
: … { … }
ConnectionTracker::ConnectionListener::~ConnectionListener() = default;
std::unique_ptr<net::StreamSocket>
ConnectionTracker::ConnectionListener::AcceptedSocket(
std::unique_ptr<net::StreamSocket> connection) { … }
void ConnectionTracker::ConnectionListener::ReadFromSocket(
const net::StreamSocket& connection,
int rv) { … }
}