| 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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| 11 #include "net/quic/quic_connection.h" | 11 #include "net/quic/quic_connection.h" |
| 12 #include "net/quic/quic_packet_writer.h" | 12 #include "net/quic/quic_packet_writer.h" |
| 13 #include "net/quic/quic_session.h" | 13 #include "net/quic/quic_session.h" |
| 14 #include "net/quic/quic_spdy_decompressor.h" | 14 #include "net/quic/quic_spdy_decompressor.h" |
| 15 #include "net/spdy/spdy_framer.h" | 15 #include "net/spdy/spdy_framer.h" |
| 16 #include "net/tools/quic/quic_server_session.h" | 16 #include "net/tools/quic/quic_server_session.h" |
| 17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 class EpollServer; | 21 class EpollServer; |
| 22 class IPEndPoint; | 22 class IPEndPoint; |
| 23 | 23 |
| 24 namespace tools { | 24 namespace tools { |
| 25 namespace test { | 25 namespace test { |
| 26 | 26 |
| 27 // Upper limit on versions we support. |
| 28 QuicVersion QuicVersionMax(); |
| 29 |
| 30 // Lower limit on versions we support. |
| 31 QuicVersion QuicVersionMin(); |
| 32 |
| 27 // Simple random number generator used to compute random numbers suitable | 33 // Simple random number generator used to compute random numbers suitable |
| 28 // for pseudo-randomly dropping packets in tests. It works by computing | 34 // for pseudo-randomly dropping packets in tests. It works by computing |
| 29 // the sha1 hash of the current seed, and using the first 64 bits as | 35 // the sha1 hash of the current seed, and using the first 64 bits as |
| 30 // the next random number, and the next seed. | 36 // the next random number, and the next seed. |
| 31 class SimpleRandom { | 37 class SimpleRandom { |
| 32 public: | 38 public: |
| 33 SimpleRandom() : seed_(0) {} | 39 SimpleRandom() : seed_(0) {} |
| 34 | 40 |
| 35 // Returns a random number in the range [0, kuint64max]. | 41 // Returns a random number in the range [0, kuint64max]. |
| 36 uint64 RandUint64(); | 42 uint64 RandUint64(); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 virtual ~MockAckNotifierDelegate(); | 159 virtual ~MockAckNotifierDelegate(); |
| 154 | 160 |
| 155 MOCK_METHOD0(OnAckNotification, void()); | 161 MOCK_METHOD0(OnAckNotification, void()); |
| 156 }; | 162 }; |
| 157 | 163 |
| 158 } // namespace test | 164 } // namespace test |
| 159 } // namespace tools | 165 } // namespace tools |
| 160 } // namespace net | 166 } // namespace net |
| 161 | 167 |
| 162 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ | 168 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_UTILS_H_ |
| OLD | NEW |