| 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 17 matching lines...) Expand all Loading... |
| 28 void CompareCharArraysWithHexError(const std::string& description, | 28 void CompareCharArraysWithHexError(const std::string& description, |
| 29 const char* actual, | 29 const char* actual, |
| 30 const int actual_len, | 30 const int actual_len, |
| 31 const char* expected, | 31 const char* expected, |
| 32 const int expected_len); | 32 const int expected_len); |
| 33 | 33 |
| 34 void CompareQuicDataWithHexError(const std::string& description, | 34 void CompareQuicDataWithHexError(const std::string& description, |
| 35 QuicData* actual, | 35 QuicData* actual, |
| 36 QuicData* expected); | 36 QuicData* expected); |
| 37 | 37 |
| 38 // Returns the length of the QuicPacket that will be created if it contains | 38 // Returns the length of a QuicPacket that is capable of holding either a |
| 39 // a stream frame that has |payload| bytes. | 39 // stream frame or a minimal ack frame. Sets |*payload_length| to the number |
| 40 // of bytes of stream data that will fit in such a packet. |
| 40 size_t GetPacketLengthForOneStream( | 41 size_t GetPacketLengthForOneStream( |
| 41 bool include_version, InFecGroup is_in_fec_group, size_t payload); | 42 bool include_version, InFecGroup is_in_fec_group, size_t* payload_length); |
| 42 | 43 |
| 43 string SerializeUncompressedHeaders(const SpdyHeaderBlock& headers); | 44 string SerializeUncompressedHeaders(const SpdyHeaderBlock& headers); |
| 44 | 45 |
| 45 // Returns QuicConfig set to default values. | 46 // Returns QuicConfig set to default values. |
| 46 QuicConfig DefaultQuicConfig(); | 47 QuicConfig DefaultQuicConfig(); |
| 47 | 48 |
| 48 class MockFramerVisitor : public QuicFramerVisitorInterface { | 49 class MockFramerVisitor : public QuicFramerVisitorInterface { |
| 49 public: | 50 public: |
| 50 MockFramerVisitor(); | 51 MockFramerVisitor(); |
| 51 ~MockFramerVisitor(); | 52 ~MockFramerVisitor(); |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 364 |
| 364 private: | 365 private: |
| 365 string data_; | 366 string data_; |
| 366 bool error_; | 367 bool error_; |
| 367 }; | 368 }; |
| 368 | 369 |
| 369 } // namespace test | 370 } // namespace test |
| 370 } // namespace net | 371 } // namespace net |
| 371 | 372 |
| 372 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 373 #endif // NET_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |