OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_HTTP2_DECODER_HTTP2_STRUCTURE_DECODER_TEST_UTIL_H_ |
| 6 #define NET_HTTP2_DECODER_HTTP2_STRUCTURE_DECODER_TEST_UTIL_H_ |
| 7 |
| 8 #include "net/http2/decoder/http2_structure_decoder.h" |
| 9 |
| 10 #include <cstddef> |
| 11 |
| 12 #include "net/http2/tools/http2_random.h" |
| 13 |
| 14 namespace net { |
| 15 namespace test { |
| 16 |
| 17 class Http2StructureDecoderPeer { |
| 18 public: |
| 19 static void Randomize(Http2StructureDecoder* p, RandomBase* rng) { |
| 20 p->offset_ = rng->Rand32(); |
| 21 for (size_t i = 0; i < sizeof p->buffer_; ++i) { |
| 22 p->buffer_[i] = rng->Rand8(); |
| 23 } |
| 24 } |
| 25 }; |
| 26 |
| 27 } // namespace test |
| 28 } // namespace net |
| 29 |
| 30 #endif // NET_HTTP2_DECODER_HTTP2_STRUCTURE_DECODER_TEST_UTIL_H_ |
OLD | NEW |