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 <stddef.h> | 10 #include <stddef.h> |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 488 |
489 PacketSavingConnection(MockQuicConnectionHelper* helper, | 489 PacketSavingConnection(MockQuicConnectionHelper* helper, |
490 MockAlarmFactory* alarm_factory, | 490 MockAlarmFactory* alarm_factory, |
491 Perspective perspective, | 491 Perspective perspective, |
492 const QuicVersionVector& supported_versions); | 492 const QuicVersionVector& supported_versions); |
493 | 493 |
494 ~PacketSavingConnection() override; | 494 ~PacketSavingConnection() override; |
495 | 495 |
496 void SendOrQueuePacket(SerializedPacket* packet) override; | 496 void SendOrQueuePacket(SerializedPacket* packet) override; |
497 | 497 |
498 std::vector<QuicEncryptedPacket*> encrypted_packets_; | 498 std::vector<std::unique_ptr<QuicEncryptedPacket>> encrypted_packets_; |
499 | 499 |
500 private: | 500 private: |
501 DISALLOW_COPY_AND_ASSIGN(PacketSavingConnection); | 501 DISALLOW_COPY_AND_ASSIGN(PacketSavingConnection); |
502 }; | 502 }; |
503 | 503 |
504 class MockQuicSession : public QuicSession { | 504 class MockQuicSession : public QuicSession { |
505 public: | 505 public: |
506 // Takes ownership of |connection|. | 506 // Takes ownership of |connection|. |
507 explicit MockQuicSession(QuicConnection* connection); | 507 explicit MockQuicSession(QuicConnection* connection); |
508 ~MockQuicSession() override; | 508 ~MockQuicSession() override; |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 T absolute_margin = expected * relative_margin; | 1044 T absolute_margin = expected * relative_margin; |
1045 | 1045 |
1046 EXPECT_GE(expected + absolute_margin, actual); | 1046 EXPECT_GE(expected + absolute_margin, actual); |
1047 EXPECT_LE(expected - absolute_margin, actual); | 1047 EXPECT_LE(expected - absolute_margin, actual); |
1048 } | 1048 } |
1049 | 1049 |
1050 } // namespace test | 1050 } // namespace test |
1051 } // namespace net | 1051 } // namespace net |
1052 | 1052 |
1053 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 1053 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
OLD | NEW |