// Copyright 2015 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_QUIC_MOCK_QUIC_DATA_H_ #define NET_QUIC_MOCK_QUIC_DATA_H_ #include "net/quic/quic_test_packet_printer.h" #include "net/socket/socket_test_util.h" #include "net/third_party/quiche/src/quiche/quic/core/quic_packets.h" namespace net::test { // Helper class to encapsulate MockReads and MockWrites for QUIC. // Simplify ownership issues and the interaction with the MockSocketFactory. // // To use, construct an instance, call the `Add*` methods in the desired order, // and then call `AddSocketDataToFactory(socket_factory)` to add a socket with // the defined behavior to the socket factory. Alternately, use // `InitializeAndGetSequencedSocketData()` and pass the result to a mock socket // like `MockUDPClientSocket`. // // The MockQuicData instance must remain live until the socket is created and // ultimately closed. class MockQuicData { … }; } // namespace net::test #endif // NET_QUIC_MOCK_QUIC_DATA_H_