| 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 4de2cadd2e5b6367297fcafc822f6d682b686a16..d1ae82e62995552899c22a884bb2d62a39655cee 100644
|
| --- a/net/quic/test_tools/quic_test_utils.cc
|
| +++ b/net/quic/test_tools/quic_test_utils.cc
|
| @@ -231,40 +231,46 @@ void MockHelper::AdvanceTime(QuicTime::Delta delta) {
|
| clock_.AdvanceTime(delta);
|
| }
|
|
|
| -MockConnection::MockConnection(QuicGuid guid,
|
| - IPEndPoint address,
|
| +MockConnection::MockConnection(bool is_server)
|
| + : QuicConnection(kTestGuid,
|
| + IPEndPoint(Loopback4(), kTestPort),
|
| + new testing::NiceMock<MockHelper>(),
|
| + new testing::NiceMock<MockPacketWriter>(),
|
| + is_server, QuicSupportedVersions()),
|
| + writer_(QuicConnectionPeer::GetWriter(this)),
|
| + helper_(helper()) {
|
| +}
|
| +
|
| +MockConnection::MockConnection(IPEndPoint address,
|
| bool is_server)
|
| - : QuicConnection(guid, address, new testing::NiceMock<MockHelper>(),
|
| + : QuicConnection(kTestGuid, address,
|
| + new testing::NiceMock<MockHelper>(),
|
| new testing::NiceMock<MockPacketWriter>(),
|
| is_server, QuicSupportedVersions()),
|
| - has_mock_helper_(true),
|
| writer_(QuicConnectionPeer::GetWriter(this)),
|
| helper_(helper()) {
|
| }
|
|
|
| MockConnection::MockConnection(QuicGuid guid,
|
| - IPEndPoint address,
|
| - QuicConnectionHelperInterface* helper,
|
| - QuicPacketWriter* writer,
|
| bool is_server)
|
| - : QuicConnection(guid, address, helper, writer, is_server,
|
| - QuicSupportedVersions()),
|
| - has_mock_helper_(false) {
|
| + : QuicConnection(guid,
|
| + IPEndPoint(Loopback4(), kTestPort),
|
| + new testing::NiceMock<MockHelper>(),
|
| + new testing::NiceMock<MockPacketWriter>(),
|
| + is_server, QuicSupportedVersions()),
|
| + writer_(QuicConnectionPeer::GetWriter(this)),
|
| + helper_(helper()) {
|
| }
|
|
|
| MockConnection::~MockConnection() {
|
| }
|
|
|
| void MockConnection::AdvanceTime(QuicTime::Delta delta) {
|
| - CHECK(has_mock_helper_) << "Cannot advance time unless a MockClock is being"
|
| - " used";
|
| static_cast<MockHelper*>(helper())->AdvanceTime(delta);
|
| }
|
|
|
| -PacketSavingConnection::PacketSavingConnection(QuicGuid guid,
|
| - IPEndPoint address,
|
| - bool is_server)
|
| - : MockConnection(guid, address, is_server) {
|
| +PacketSavingConnection::PacketSavingConnection(bool is_server)
|
| + : MockConnection(is_server) {
|
| }
|
|
|
| PacketSavingConnection::~PacketSavingConnection() {
|
| @@ -372,6 +378,12 @@ QuicVersion QuicVersionMax() { return QuicSupportedVersions().front(); }
|
|
|
| QuicVersion QuicVersionMin() { return QuicSupportedVersions().back(); }
|
|
|
| +IPAddressNumber Loopback4() {
|
| + net::IPAddressNumber addr;
|
| + CHECK(net::ParseIPLiteralToNumber("127.0.0.1", &addr));
|
| + return addr;
|
| +}
|
| +
|
| void CompareCharArraysWithHexError(
|
| const string& description,
|
| const char* actual,
|
|
|