| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Common utilities for Quic tests | 5 // Common utilities for Quic tests |
| 6 | 6 |
| 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 7 #ifndef NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 8 #define NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 private: | 321 private: |
| 322 DISALLOW_COPY_AND_ASSIGN(NiceMockPacketWriterFactory); | 322 DISALLOW_COPY_AND_ASSIGN(NiceMockPacketWriterFactory); |
| 323 }; | 323 }; |
| 324 | 324 |
| 325 class MockConnection : public QuicConnection { | 325 class MockConnection : public QuicConnection { |
| 326 public: | 326 public: |
| 327 // Uses a MockHelper, ConnectionId of 42, and 127.0.0.1:123. | 327 // Uses a MockHelper, ConnectionId of 42, and 127.0.0.1:123. |
| 328 explicit MockConnection(Perspective perspective); | 328 explicit MockConnection(Perspective perspective); |
| 329 | 329 |
| 330 // Uses a MockHelper, ConnectionId of 42, and 127.0.0.1:123. | |
| 331 MockConnection(Perspective perspective, bool is_secure); | |
| 332 | |
| 333 // Uses a MockHelper, ConnectionId of 42. | 330 // Uses a MockHelper, ConnectionId of 42. |
| 334 MockConnection(IPEndPoint address, Perspective perspective); | 331 MockConnection(IPEndPoint address, Perspective perspective); |
| 335 | 332 |
| 336 // Uses a MockHelper, and 127.0.0.1:123. | 333 // Uses a MockHelper, and 127.0.0.1:123. |
| 337 MockConnection(QuicConnectionId connection_id, Perspective perspective); | 334 MockConnection(QuicConnectionId connection_id, Perspective perspective); |
| 338 | 335 |
| 339 // Uses a MockHelper, and 127.0.0.1:123. | |
| 340 MockConnection(QuicConnectionId connection_id, | |
| 341 Perspective perspective, | |
| 342 bool is_secure); | |
| 343 | |
| 344 // Uses a Mock helper, ConnectionId of 42, and 127.0.0.1:123. | 336 // Uses a Mock helper, ConnectionId of 42, and 127.0.0.1:123. |
| 345 MockConnection(Perspective perspective, | 337 MockConnection(Perspective perspective, |
| 346 const QuicVersionVector& supported_versions); | 338 const QuicVersionVector& supported_versions); |
| 347 | 339 |
| 348 MockConnection(QuicConnectionId connection_id, | 340 MockConnection(QuicConnectionId connection_id, |
| 349 IPEndPoint address, | 341 IPEndPoint address, |
| 350 Perspective perspective, | 342 Perspective perspective, |
| 351 bool is_secure, | |
| 352 const QuicVersionVector& supported_versions); | 343 const QuicVersionVector& supported_versions); |
| 353 | 344 |
| 354 ~MockConnection() override; | 345 ~MockConnection() override; |
| 355 | 346 |
| 356 // If the constructor that uses a MockHelper has been used then this method | 347 // If the constructor that uses a MockHelper has been used then this method |
| 357 // will advance the time of the MockClock. | 348 // will advance the time of the MockClock. |
| 358 void AdvanceTime(QuicTime::Delta delta); | 349 void AdvanceTime(QuicTime::Delta delta); |
| 359 | 350 |
| 360 MOCK_METHOD3(ProcessUdpPacket, void(const IPEndPoint& self_address, | 351 MOCK_METHOD3(ProcessUdpPacket, void(const IPEndPoint& self_address, |
| 361 const IPEndPoint& peer_address, | 352 const IPEndPoint& peer_address, |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 void CreateServerSessionForTest(QuicServerId server_id, | 760 void CreateServerSessionForTest(QuicServerId server_id, |
| 770 QuicTime::Delta connection_start_time, | 761 QuicTime::Delta connection_start_time, |
| 771 QuicCryptoServerConfig* crypto_server_config, | 762 QuicCryptoServerConfig* crypto_server_config, |
| 772 PacketSavingConnection** server_connection, | 763 PacketSavingConnection** server_connection, |
| 773 TestQuicSpdyServerSession** server_session); | 764 TestQuicSpdyServerSession** server_session); |
| 774 | 765 |
| 775 } // namespace test | 766 } // namespace test |
| 776 } // namespace net | 767 } // namespace net |
| 777 | 768 |
| 778 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 769 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |