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.
5 #ifndef NET_SPDY_TEST_UTILS_H_
6 #define NET_SPDY_TEST_UTILS_H_
12 #include "net/spdy/spdy_protocol.h"
17 class TransportSecurityState
;
21 std::string
HexDumpWithMarks(const unsigned char* data
, int length
,
22 const bool* marks
, int mark_length
);
24 void CompareCharArraysWithHexError(
25 const std::string
& description
,
26 const unsigned char* actual
,
28 const unsigned char* expected
,
29 const int expected_len
);
31 void SetFrameFlags(SpdyFrame
* frame
,
33 SpdyMajorVersion spdy_version
);
35 void SetFrameLength(SpdyFrame
* frame
,
37 SpdyMajorVersion spdy_version
);
39 std::string
a2b_hex(const char* hex_data
);
41 // Returns a SHA1 HashValue in which each byte has the value |label|.
42 HashValue
GetTestHashValue(uint8_t label
);
44 // Returns SHA1 pinning header for the of the base64 encoding of
45 // GetTestHashValue(|label|).
46 std::string
GetTestPin(uint8_t label
);
48 // Adds a pin for |host| to |state|.
49 void AddPin(TransportSecurityState
* state
,
50 const std::string
& host
,
51 uint8_t primary_label
,
52 uint8_t backup_label
);
58 #endif // NET_SPDY_TEST_UTILS_H_