| Index: net/quic/test_tools/quic_test_utils.cc
|
| diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
|
| index ae3abfed7fa5578b54b8f591541bad3877335f53..13e5eb169b1c97ae6573e8a420e2f3f5a2a1a787 100644
|
| --- a/net/quic/test_tools/quic_test_utils.cc
|
| +++ b/net/quic/test_tools/quic_test_utils.cc
|
| @@ -221,21 +221,10 @@ void MockHelper::AdvanceTime(QuicTime::Delta delta) {
|
| clock_.AdvanceTime(delta);
|
| }
|
|
|
| -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,
|
| @@ -243,7 +232,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(TestPeerIPAddress(), kTestPort),
|
| + new testing::NiceMock<MockHelper>(),
|
| + NiceMockPacketWriterFactory(),
|
| + /* owns_writer= */ true,
|
| + is_server,
|
| + is_secure,
|
| + QuicSupportedVersions()),
|
| helper_(helper()) {
|
| }
|
|
|
| @@ -253,7 +256,9 @@ MockConnection::MockConnection(IPEndPoint address,
|
| new testing::NiceMock<MockHelper>(),
|
| NiceMockPacketWriterFactory(),
|
| /* owns_writer= */ true,
|
| - is_server, QuicSupportedVersions()),
|
| + is_server,
|
| + /* is_secure= */ false,
|
| + QuicSupportedVersions()),
|
| helper_(helper()) {
|
| }
|
|
|
| @@ -264,7 +269,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()) {
|
| }
|
|
|
| @@ -275,7 +282,9 @@ MockConnection::MockConnection(bool is_server,
|
| new testing::NiceMock<MockHelper>(),
|
| NiceMockPacketWriterFactory(),
|
| /* owns_writer= */ true,
|
| - is_server, supported_versions),
|
| + is_server,
|
| + /* is_secure= */ false,
|
| + supported_versions),
|
| helper_(helper()) {
|
| }
|
|
|
| @@ -316,7 +325,7 @@ void PacketSavingConnection::SendOrQueuePacket(QueuedPacket packet) {
|
| }
|
|
|
| MockSession::MockSession(QuicConnection* connection)
|
| - : QuicSession(connection, DefaultQuicConfig(), /*is_secure=*/false) {
|
| + : QuicSession(connection, DefaultQuicConfig()) {
|
| InitializeSession();
|
| ON_CALL(*this, WritevData(_, _, _, _, _, _))
|
| .WillByDefault(testing::Return(QuicConsumedData(0, false)));
|
| @@ -326,7 +335,7 @@ MockSession::~MockSession() {
|
| }
|
|
|
| TestSession::TestSession(QuicConnection* connection, const QuicConfig& config)
|
| - : QuicSession(connection, config, /*is_secure=*/false),
|
| + : QuicSession(connection, config),
|
| crypto_stream_(nullptr) {
|
| InitializeSession();
|
| }
|
| @@ -343,7 +352,7 @@ QuicCryptoStream* TestSession::GetCryptoStream() {
|
|
|
| TestClientSession::TestClientSession(QuicConnection* connection,
|
| const QuicConfig& config)
|
| - : QuicClientSessionBase(connection, config, /*is_secure=*/false),
|
| + : QuicClientSessionBase(connection, config),
|
| crypto_stream_(nullptr) {
|
| EXPECT_CALL(*this, OnProofValid(_)).Times(AnyNumber());
|
| InitializeSession();
|
|
|