OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_SPDY_TEST_UTILS_H_ | 5 #ifndef NET_SPDY_TEST_UTILS_H_ |
6 #define NET_SPDY_TEST_UTILS_H_ | 6 #define NET_SPDY_TEST_UTILS_H_ |
7 | 7 |
| 8 #include <stddef.h> |
8 #include <stdint.h> | 9 #include <stdint.h> |
9 | 10 |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "net/spdy/spdy_header_block.h" | 13 #include "net/spdy/spdy_header_block.h" |
13 #include "net/spdy/spdy_protocol.h" | 14 #include "net/spdy/spdy_protocol.h" |
14 | 15 |
15 namespace net { | 16 namespace net { |
16 | 17 |
17 class HashValue; | 18 class HashValue; |
(...skipping 10 matching lines...) Expand all Loading... |
28 const bool* marks, int mark_length); | 29 const bool* marks, int mark_length); |
29 | 30 |
30 void CompareCharArraysWithHexError( | 31 void CompareCharArraysWithHexError( |
31 const std::string& description, | 32 const std::string& description, |
32 const unsigned char* actual, | 33 const unsigned char* actual, |
33 const int actual_len, | 34 const int actual_len, |
34 const unsigned char* expected, | 35 const unsigned char* expected, |
35 const int expected_len); | 36 const int expected_len); |
36 | 37 |
37 void SetFrameFlags(SpdyFrame* frame, | 38 void SetFrameFlags(SpdyFrame* frame, |
38 uint8 flags, | 39 uint8_t flags, |
39 SpdyMajorVersion spdy_version); | 40 SpdyMajorVersion spdy_version); |
40 | 41 |
41 void SetFrameLength(SpdyFrame* frame, | 42 void SetFrameLength(SpdyFrame* frame, |
42 size_t length, | 43 size_t length, |
43 SpdyMajorVersion spdy_version); | 44 SpdyMajorVersion spdy_version); |
44 | 45 |
45 std::string a2b_hex(const char* hex_data); | 46 std::string a2b_hex(const char* hex_data); |
46 | 47 |
47 // Returns a SHA1 HashValue in which each byte has the value |label|. | 48 // Returns a SHA1 HashValue in which each byte has the value |label|. |
48 HashValue GetTestHashValue(uint8_t label); | 49 HashValue GetTestHashValue(uint8_t label); |
49 | 50 |
50 // Returns SHA1 pinning header for the of the base64 encoding of | 51 // Returns SHA1 pinning header for the of the base64 encoding of |
51 // GetTestHashValue(|label|). | 52 // GetTestHashValue(|label|). |
52 std::string GetTestPin(uint8_t label); | 53 std::string GetTestPin(uint8_t label); |
53 | 54 |
54 // Adds a pin for |host| to |state|. | 55 // Adds a pin for |host| to |state|. |
55 void AddPin(TransportSecurityState* state, | 56 void AddPin(TransportSecurityState* state, |
56 const std::string& host, | 57 const std::string& host, |
57 uint8_t primary_label, | 58 uint8_t primary_label, |
58 uint8_t backup_label); | 59 uint8_t backup_label); |
59 | 60 |
60 } // namespace test | 61 } // namespace test |
61 } // namespace net | 62 } // namespace net |
62 | 63 |
63 #endif // NET_SPDY_TEST_UTILS_H_ | 64 #endif // NET_SPDY_TEST_UTILS_H_ |
OLD | NEW |