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 #include "quiche/http2/test_tools/frame_decoder_state_test_util.h" 6 7 #include "quiche/http2/http2_structures.h" 8 #include "quiche/http2/test_tools/http2_random.h" 9 #include "quiche/http2/test_tools/http2_structure_decoder_test_util.h" 10 #include "quiche/http2/test_tools/http2_structures_test_util.h" 11 #include "quiche/http2/test_tools/random_decoder_test_base.h" 12 #include "quiche/common/platform/api/quiche_logging.h" 13 14 namespace http2 { 15 namespace test { 16 17 // static Randomize(FrameDecoderState * p,Http2Random * rng)18void FrameDecoderStatePeer::Randomize(FrameDecoderState* p, Http2Random* rng) { 19 QUICHE_VLOG(1) << "FrameDecoderStatePeer::Randomize"; 20 ::http2::test::Randomize(&p->frame_header_, rng); 21 p->remaining_payload_ = rng->Rand32(); 22 p->remaining_padding_ = rng->Rand32(); 23 Http2StructureDecoderPeer::Randomize(&p->structure_decoder_, rng); 24 } 25 26 // static set_frame_header(const Http2FrameHeader & header,FrameDecoderState * p)27void FrameDecoderStatePeer::set_frame_header(const Http2FrameHeader& header, 28 FrameDecoderState* p) { 29 QUICHE_VLOG(1) << "FrameDecoderStatePeer::set_frame_header " << header; 30 p->frame_header_ = header; 31 } 32 33 } // namespace test 34 } // namespace http2 35