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 9a513f90d54e0ed77409034eb03b67357b41e9c1..1aad3273832650210d80bd3d794b809687e3de55 100644 |
--- a/net/tools/quic/test_tools/quic_test_utils.cc |
+++ b/net/tools/quic/test_tools/quic_test_utils.cc |
@@ -17,51 +17,41 @@ namespace net { |
namespace tools { |
namespace test { |
-QuicVersion QuicVersionMax() { return QuicSupportedVersions().front(); } |
- |
-QuicVersion QuicVersionMin() { return QuicSupportedVersions().back(); } |
- |
-MockConnection::MockConnection(QuicGuid guid, |
- IPEndPoint address, |
- int fd, |
- EpollServer* eps, |
- bool is_server) |
- : QuicConnection(guid, address, |
- new QuicEpollConnectionHelper(eps), |
- new QuicDefaultPacketWriter(fd), is_server, |
- QuicSupportedVersions()), |
- has_mock_helper_(false), |
+MockConnection::MockConnection(bool is_server) |
+ : QuicConnection(kTestGuid, |
+ IPEndPoint(net::test::Loopback4(), kTestPort), |
+ new testing::NiceMock<MockHelper>(), |
+ new testing::NiceMock<MockPacketWriter>(), |
+ is_server, QuicSupportedVersions()), |
writer_(net::test::QuicConnectionPeer::GetWriter(this)), |
helper_(helper()) { |
} |
-MockConnection::MockConnection(QuicGuid guid, |
- IPEndPoint address, |
+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_(net::test::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(net::test::Loopback4(), kTestPort), |
+ new testing::NiceMock<MockHelper>(), |
+ new testing::NiceMock<MockPacketWriter>(), |
+ is_server, QuicSupportedVersions()), |
+ writer_(net::test::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); |
} |
@@ -74,9 +64,8 @@ uint64 SimpleRandom::RandUint64() { |
} |
TestSession::TestSession(QuicConnection* connection, |
- const QuicConfig& config, |
- bool is_server) |
- : QuicSession(connection, config, is_server), |
+ const QuicConfig& config) |
+ : QuicSession(connection, config), |
crypto_stream_(NULL) { |
} |