| Index: net/tools/quic/test_tools/quic_test_utils.cc
|
| diff --git a/net/tools/quic/test_tools/quic_test_utils.cc b/net/tools/quic/test_tools/quic_test_utils.cc
|
| index 40b7e88ef8e1f2a4cb8dd61835da3e3211c8ae8f..91cd003b52c27f035ae29133d55f140bb31b5b49 100644
|
| --- a/net/tools/quic/test_tools/quic_test_utils.cc
|
| +++ b/net/tools/quic/test_tools/quic_test_utils.cc
|
| @@ -18,21 +18,10 @@ namespace net {
|
| namespace tools {
|
| namespace test {
|
|
|
| -namespace {
|
| -class NiceMockPacketWriterFactory
|
| - : public QuicConnection::PacketWriterFactory {
|
| - public:
|
| - NiceMockPacketWriterFactory() {}
|
| - ~NiceMockPacketWriterFactory() override {}
|
| -
|
| - QuicPacketWriter* Create(QuicConnection* /*connection*/) const override {
|
| - return new testing::NiceMock<MockPacketWriter>();
|
| - }
|
| -
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(NiceMockPacketWriterFactory);
|
| -};
|
| -} // namespace
|
| +QuicPacketWriter* NiceMockPacketWriterFactory::Create(
|
| + QuicConnection* /*connection*/) const {
|
| + return new testing::NiceMock<MockPacketWriter>();
|
| +}
|
|
|
| MockConnection::MockConnection(bool is_server)
|
| : QuicConnection(kTestConnectionId,
|
| @@ -40,7 +29,21 @@ MockConnection::MockConnection(bool is_server)
|
| new testing::NiceMock<MockHelper>(),
|
| NiceMockPacketWriterFactory(),
|
| /* owns_writer= */ true,
|
| - is_server, QuicSupportedVersions()),
|
| + is_server,
|
| + /* is_secure= */ false,
|
| + QuicSupportedVersions()),
|
| + helper_(helper()) {
|
| +}
|
| +
|
| +MockConnection::MockConnection(bool is_server, bool is_secure)
|
| + : QuicConnection(kTestConnectionId,
|
| + IPEndPoint(net::test::Loopback4(), kTestPort),
|
| + new testing::NiceMock<MockHelper>(),
|
| + NiceMockPacketWriterFactory(),
|
| + /* owns_writer= */ true,
|
| + is_server,
|
| + is_secure,
|
| + QuicSupportedVersions()),
|
| helper_(helper()) {
|
| }
|
|
|
| @@ -50,7 +53,9 @@ MockConnection::MockConnection(IPEndPoint address,
|
| new testing::NiceMock<MockHelper>(),
|
| NiceMockPacketWriterFactory(),
|
| /* owns_writer= */ true,
|
| - is_server, QuicSupportedVersions()),
|
| + is_server,
|
| + /* is_secure= */ false,
|
| + QuicSupportedVersions()),
|
| helper_(helper()) {
|
| }
|
|
|
| @@ -61,7 +66,9 @@ MockConnection::MockConnection(QuicConnectionId connection_id,
|
| new testing::NiceMock<MockHelper>(),
|
| NiceMockPacketWriterFactory(),
|
| /* owns_writer= */ true,
|
| - is_server, QuicSupportedVersions()),
|
| + is_server,
|
| + /* is_secure= */ false,
|
| + QuicSupportedVersions()),
|
| helper_(helper()) {
|
| }
|
|
|
| @@ -72,7 +79,9 @@ MockConnection::MockConnection(bool is_server,
|
| new testing::NiceMock<MockHelper>(),
|
| NiceMockPacketWriterFactory(),
|
| /* owns_writer= */ true,
|
| - is_server, QuicSupportedVersions()),
|
| + is_server,
|
| + /* is_secure= */ false,
|
| + supported_versions),
|
| helper_(helper()) {
|
| }
|
|
|
| @@ -93,9 +102,8 @@ QuicAckFrame MakeAckFrameWithNackRanges(
|
| return ack;
|
| }
|
|
|
| -TestSession::TestSession(QuicConnection* connection,
|
| - const QuicConfig& config)
|
| - : QuicSession(connection, config, /*is_secure=*/false),
|
| +TestSession::TestSession(QuicConnection* connection, const QuicConfig& config)
|
| + : QuicSession(connection, config),
|
| crypto_stream_(nullptr) {
|
| InitializeSession();
|
| }
|
|
|