blob: d00f3b0fadab92707d328cfd8a4ac13e8ad227ba [file] [log] [blame]
QUICHE team82dee2f2019-01-18 12:35:12 -05001// 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
3// found in the LICENSE file.
4
5#ifndef QUICHE_SPDY_CORE_SPDY_TEST_UTILS_H_
6#define QUICHE_SPDY_CORE_SPDY_TEST_UTILS_H_
7
8#include <cstddef>
9#include <cstdint>
bnc44712912019-08-15 18:58:14 -070010#include <string>
QUICHE team82dee2f2019-01-18 12:35:12 -050011
vasilvvc8ccdb22020-10-12 16:42:34 -070012#include "absl/strings/string_view.h"
QUICHE team5be974e2020-12-29 18:35:24 -050013#include "spdy/core/spdy_header_block.h"
14#include "spdy/core/spdy_protocol.h"
QUICHE team82dee2f2019-01-18 12:35:12 -050015
16namespace spdy {
17
vasilvvc8ccdb22020-10-12 16:42:34 -070018inline bool operator==(absl::string_view x,
QUICHE team232cf492020-10-27 08:21:26 -070019 const Http2HeaderBlock::ValueProxy& y) {
QUICHE team3f57c752019-12-16 14:09:53 -080020 return y.operator==(x);
QUICHE team82dee2f2019-01-18 12:35:12 -050021}
22
23namespace test {
24
bnc44712912019-08-15 18:58:14 -070025std::string HexDumpWithMarks(const unsigned char* data,
26 int length,
27 const bool* marks,
28 int mark_length);
QUICHE team82dee2f2019-01-18 12:35:12 -050029
bnc44712912019-08-15 18:58:14 -070030void CompareCharArraysWithHexError(const std::string& description,
QUICHE team82dee2f2019-01-18 12:35:12 -050031 const unsigned char* actual,
32 const int actual_len,
33 const unsigned char* expected,
34 const int expected_len);
35
36void SetFrameFlags(SpdySerializedFrame* frame, uint8_t flags);
37
38void SetFrameLength(SpdySerializedFrame* frame, size_t length);
39
QUICHE team82dee2f2019-01-18 12:35:12 -050040} // namespace test
41} // namespace spdy
42
43#endif // QUICHE_SPDY_CORE_SPDY_TEST_UTILS_H_