| Index: net/quic/test_tools/quic_test_utils.cc
|
| diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
|
| index 1514f2d28df230b3172c9e548d0ac19b704b78d8..6353f47d8600a39f39cc62b298ed4265b9d05b44 100644
|
| --- a/net/quic/test_tools/quic_test_utils.cc
|
| +++ b/net/quic/test_tools/quic_test_utils.cc
|
| @@ -117,6 +117,22 @@ uint64_t SimpleRandom::RandUint64() {
|
| return seed_;
|
| }
|
|
|
| +void SimpleRandom::RandBytes(void* data, size_t len) {
|
| + uint8_t* real_data = static_cast<uint8_t*>(data);
|
| + for (size_t offset = 0; offset < len; offset++) {
|
| + real_data[offset] = RandUint64() & 0xff;
|
| + }
|
| +}
|
| +
|
| +void SimpleRandom::Reseed(const void* additional_entropy, size_t len) {
|
| + const uint8_t* real_entropy = static_cast<const uint8_t*>(additional_entropy);
|
| + for (size_t offset = 0; offset < len; offset++) {
|
| + // Note: this is not actually a well-established way to incorporate new
|
| + // entropy, but good enough for tests.
|
| + seed_ *= real_entropy[len];
|
| + }
|
| +}
|
| +
|
| MockFramerVisitor::MockFramerVisitor() {
|
| // By default, we want to accept packets.
|
| ON_CALL(*this, OnProtocolVersionMismatch(_))
|
|
|