| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Testing convenience method to construct a QuicAckFrame with all packets | 89 // Testing convenience method to construct a QuicAckFrame with all packets |
| 90 // from least_unacked to largest_observed acked. | 90 // from least_unacked to largest_observed acked. |
| 91 QuicAckFrame MakeAckFrame(QuicPacketSequenceNumber largest_observed, | 91 QuicAckFrame MakeAckFrame(QuicPacketSequenceNumber largest_observed, |
| 92 QuicPacketSequenceNumber least_unacked); | 92 QuicPacketSequenceNumber least_unacked); |
| 93 | 93 |
| 94 // Testing convenience method to construct a QuicAckFrame with |num_nack_ranges| | 94 // Testing convenience method to construct a QuicAckFrame with |num_nack_ranges| |
| 95 // nack ranges of width 1 packet, starting from |least_unacked|. | 95 // nack ranges of width 1 packet, starting from |least_unacked|. |
| 96 QuicAckFrame MakeAckFrameWithNackRanges(size_t num_nack_ranges, | 96 QuicAckFrame MakeAckFrameWithNackRanges(size_t num_nack_ranges, |
| 97 QuicPacketSequenceNumber least_unacked); | 97 QuicPacketSequenceNumber least_unacked); |
| 98 | 98 |
| 99 // Returns a SerializedPacket whose |packet| member is owned by the caller, | 99 // Returns a SerializedPacket whose |packet| member is owned by the caller, and |
| 100 // and is populated with the fields in |header| and |frames|, or is NULL if | 100 // is populated with the fields in |header| and |frames|, or is NULL if the |
| 101 // the packet could not be created. | 101 // packet could not be created. |
| 102 SerializedPacket BuildUnsizedDataPacket(QuicFramer* framer, | 102 SerializedPacket BuildUnsizedDataPacket(QuicFramer* framer, |
| 103 const QuicPacketHeader& header, | 103 const QuicPacketHeader& header, |
| 104 const QuicFrames& frames); | 104 const QuicFrames& frames); |
| 105 | 105 |
| 106 template<typename SaveType> | 106 template<typename SaveType> |
| 107 class ValueRestore { | 107 class ValueRestore { |
| 108 public: | 108 public: |
| 109 ValueRestore(SaveType* name, SaveType value) | 109 ValueRestore(SaveType* name, SaveType value) |
| 110 : name_(name), | 110 : name_(name), |
| 111 value_(*name) { | 111 value_(*name) { |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 virtual ~MockAckNotifierDelegate(); | 500 virtual ~MockAckNotifierDelegate(); |
| 501 | 501 |
| 502 private: | 502 private: |
| 503 DISALLOW_COPY_AND_ASSIGN(MockAckNotifierDelegate); | 503 DISALLOW_COPY_AND_ASSIGN(MockAckNotifierDelegate); |
| 504 }; | 504 }; |
| 505 | 505 |
| 506 } // namespace test | 506 } // namespace test |
| 507 } // namespace net | 507 } // namespace net |
| 508 | 508 |
| 509 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 509 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |