| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 QuicConfig DefaultQuicConfig(); | 81 QuicConfig DefaultQuicConfig(); |
| 82 | 82 |
| 83 // Returns a version vector consisting of |version|. | 83 // Returns a version vector consisting of |version|. |
| 84 QuicVersionVector SupportedVersions(QuicVersion version); | 84 QuicVersionVector SupportedVersions(QuicVersion version); |
| 85 | 85 |
| 86 // Testing convenience method to construct a QuicAckFrame with all packets | 86 // Testing convenience method to construct a QuicAckFrame with all packets |
| 87 // from least_unacked to largest_observed acked. | 87 // from least_unacked to largest_observed acked. |
| 88 QuicAckFrame MakeAckFrame(QuicPacketSequenceNumber largest_observed, | 88 QuicAckFrame MakeAckFrame(QuicPacketSequenceNumber largest_observed, |
| 89 QuicPacketSequenceNumber least_unacked); | 89 QuicPacketSequenceNumber least_unacked); |
| 90 | 90 |
| 91 // Testing convenience method to construct a QuicAckFrame with |num_nack_ranges| |
| 92 // nack ranges of width 1 packet, starting from |least_unacked|. |
| 93 QuicAckFrame MakeAckFrameWithNackRanges(size_t num_nack_ranges, |
| 94 QuicPacketSequenceNumber least_unacked); |
| 95 |
| 91 template<typename SaveType> | 96 template<typename SaveType> |
| 92 class ValueRestore { | 97 class ValueRestore { |
| 93 public: | 98 public: |
| 94 ValueRestore(SaveType* name, SaveType value) | 99 ValueRestore(SaveType* name, SaveType value) |
| 95 : name_(name), | 100 : name_(name), |
| 96 value_(*name) { | 101 value_(*name) { |
| 97 *name_ = value; | 102 *name_ = value; |
| 98 } | 103 } |
| 99 ~ValueRestore() { | 104 ~ValueRestore() { |
| 100 *name_ = value_; | 105 *name_ = value_; |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 virtual ~MockAckNotifierDelegate(); | 489 virtual ~MockAckNotifierDelegate(); |
| 485 | 490 |
| 486 private: | 491 private: |
| 487 DISALLOW_COPY_AND_ASSIGN(MockAckNotifierDelegate); | 492 DISALLOW_COPY_AND_ASSIGN(MockAckNotifierDelegate); |
| 488 }; | 493 }; |
| 489 | 494 |
| 490 } // namespace test | 495 } // namespace test |
| 491 } // namespace net | 496 } // namespace net |
| 492 | 497 |
| 493 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 498 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |