QUICHE team | 82dee2f | 2019-01-18 12:35:12 -0500 | [diff] [blame] | 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 |
| 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> |
bnc | 4471291 | 2019-08-15 18:58:14 -0700 | [diff] [blame] | 10 | #include <string> |
QUICHE team | 82dee2f | 2019-01-18 12:35:12 -0500 | [diff] [blame] | 11 | |
vasilvv | c8ccdb2 | 2020-10-12 16:42:34 -0700 | [diff] [blame] | 12 | #include "absl/strings/string_view.h" |
QUICHE team | 5be974e | 2020-12-29 18:35:24 -0500 | [diff] [blame] | 13 | #include "spdy/core/spdy_header_block.h" |
| 14 | #include "spdy/core/spdy_protocol.h" |
QUICHE team | 82dee2f | 2019-01-18 12:35:12 -0500 | [diff] [blame] | 15 | |
| 16 | namespace spdy { |
| 17 | |
vasilvv | c8ccdb2 | 2020-10-12 16:42:34 -0700 | [diff] [blame] | 18 | inline bool operator==(absl::string_view x, |
QUICHE team | 232cf49 | 2020-10-27 08:21:26 -0700 | [diff] [blame] | 19 | const Http2HeaderBlock::ValueProxy& y) { |
QUICHE team | 3f57c75 | 2019-12-16 14:09:53 -0800 | [diff] [blame] | 20 | return y.operator==(x); |
QUICHE team | 82dee2f | 2019-01-18 12:35:12 -0500 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | namespace test { |
| 24 | |
bnc | 4471291 | 2019-08-15 18:58:14 -0700 | [diff] [blame] | 25 | std::string HexDumpWithMarks(const unsigned char* data, |
| 26 | int length, |
| 27 | const bool* marks, |
| 28 | int mark_length); |
QUICHE team | 82dee2f | 2019-01-18 12:35:12 -0500 | [diff] [blame] | 29 | |
bnc | 4471291 | 2019-08-15 18:58:14 -0700 | [diff] [blame] | 30 | void CompareCharArraysWithHexError(const std::string& description, |
QUICHE team | 82dee2f | 2019-01-18 12:35:12 -0500 | [diff] [blame] | 31 | const unsigned char* actual, |
| 32 | const int actual_len, |
| 33 | const unsigned char* expected, |
| 34 | const int expected_len); |
| 35 | |
| 36 | void SetFrameFlags(SpdySerializedFrame* frame, uint8_t flags); |
| 37 | |
| 38 | void SetFrameLength(SpdySerializedFrame* frame, size_t length); |
| 39 | |
QUICHE team | 82dee2f | 2019-01-18 12:35:12 -0500 | [diff] [blame] | 40 | } // namespace test |
| 41 | } // namespace spdy |
| 42 | |
| 43 | #endif // QUICHE_SPDY_CORE_SPDY_TEST_UTILS_H_ |