Index: net/quic/test_tools/quic_test_utils.h |
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h |
index a2cf2ffbcdf62badeb276f14d482d28ac789ff87..1ef96b692deca828a5fd38680d2bae289ff53eb3 100644 |
--- a/net/quic/test_tools/quic_test_utils.h |
+++ b/net/quic/test_tools/quic_test_utils.h |
@@ -320,12 +320,23 @@ class MockConnectionHelper : public QuicConnectionHelperInterface { |
~MockConnectionHelper() override; |
const QuicClock* GetClock() const override; |
QuicRandom* GetRandomGenerator() override; |
+ QuicBufferAllocator* GetBufferAllocator() override; |
+ void AdvanceTime(QuicTime::Delta delta); |
+ |
+ private: |
+ MockClock clock_; |
+ MockRandom random_generator_; |
+ SimpleBufferAllocator buffer_allocator_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(MockConnectionHelper); |
+}; |
+ |
+class MockAlarmFactory : public QuicAlarmFactory { |
+ public: |
QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) override; |
QuicArenaScopedPtr<QuicAlarm> CreateAlarm( |
QuicArenaScopedPtr<QuicAlarm::Delegate> delegate, |
QuicConnectionArena* arena) override; |
- QuicBufferAllocator* GetBufferAllocator() override; |
- void AdvanceTime(QuicTime::Delta delta); |
// No-op alarm implementation |
class TestAlarm : public QuicAlarm { |
@@ -342,38 +353,37 @@ class MockConnectionHelper : public QuicConnectionHelperInterface { |
void FireAlarm(QuicAlarm* alarm) { |
reinterpret_cast<TestAlarm*>(alarm)->Fire(); |
} |
- |
- private: |
- MockClock clock_; |
- MockRandom random_generator_; |
- SimpleBufferAllocator buffer_allocator_; |
- |
- DISALLOW_COPY_AND_ASSIGN(MockConnectionHelper); |
}; |
class MockConnection : public QuicConnection { |
public: |
// Uses a ConnectionId of 42 and 127.0.0.1:123. |
- MockConnection(MockConnectionHelper* helper, Perspective perspective); |
+ MockConnection(MockConnectionHelper* helper, |
+ MockAlarmFactory* alarm_factory, |
+ Perspective perspective); |
// Uses a ConnectionId of 42. |
MockConnection(IPEndPoint address, |
MockConnectionHelper* helper, |
+ MockAlarmFactory* alarm_factory, |
Perspective perspective); |
// Uses 127.0.0.1:123. |
MockConnection(QuicConnectionId connection_id, |
MockConnectionHelper* helper, |
+ MockAlarmFactory* alarm_factory, |
Perspective perspective); |
// Uses a ConnectionId of 42, and 127.0.0.1:123. |
MockConnection(MockConnectionHelper* helper, |
+ MockAlarmFactory* alarm_factory, |
Perspective perspective, |
const QuicVersionVector& supported_versions); |
MockConnection(QuicConnectionId connection_id, |
IPEndPoint address, |
MockConnectionHelper* helper, |
+ MockAlarmFactory* alarm_factory, |
Perspective perspective, |
const QuicVersionVector& supported_versions); |
@@ -437,9 +447,12 @@ class MockConnection : public QuicConnection { |
class PacketSavingConnection : public MockConnection { |
public: |
- PacketSavingConnection(MockConnectionHelper* helper, Perspective perspective); |
+ PacketSavingConnection(MockConnectionHelper* helper, |
+ MockAlarmFactory* alarm_factory, |
+ Perspective perspective); |
PacketSavingConnection(MockConnectionHelper* helper, |
+ MockAlarmFactory* alarm_factory, |
Perspective perspective, |
const QuicVersionVector& supported_versions); |
@@ -803,6 +816,7 @@ void CreateClientSessionForTest(QuicServerId server_id, |
QuicTime::Delta connection_start_time, |
QuicVersionVector supported_versions, |
MockConnectionHelper* helper, |
+ MockAlarmFactory* alarm_factory, |
QuicCryptoClientConfig* crypto_client_config, |
PacketSavingConnection** client_connection, |
TestQuicSpdyClientSession** client_session); |
@@ -827,6 +841,7 @@ void CreateServerSessionForTest( |
QuicTime::Delta connection_start_time, |
QuicVersionVector supported_versions, |
MockConnectionHelper* helper, |
+ MockAlarmFactory* alarm_factory, |
QuicCryptoServerConfig* crypto_server_config, |
QuicCompressedCertsCache* compressed_certs_cache, |
PacketSavingConnection** server_connection, |