| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 const int expected_len); | 29 const int expected_len); |
| 30 | 30 |
| 31 void SetFrameFlags(SpdyFrame* frame, | 31 void SetFrameFlags(SpdyFrame* frame, |
| 32 uint8 flags, | 32 uint8 flags, |
| 33 SpdyMajorVersion spdy_version); | 33 SpdyMajorVersion spdy_version); |
| 34 | 34 |
| 35 void SetFrameLength(SpdyFrame* frame, | 35 void SetFrameLength(SpdyFrame* frame, |
| 36 size_t length, | 36 size_t length, |
| 37 SpdyMajorVersion spdy_version); | 37 SpdyMajorVersion spdy_version); |
| 38 | 38 |
| 39 // Returns true if |a| and |b| are the same size, and contain the same |
| 40 // entries in the same positions. |
| 41 bool CompareSpdyHeaderBlocks(const SpdyHeaderBlock& a, |
| 42 const SpdyHeaderBlock& b); |
| 43 |
| 39 std::string a2b_hex(const char* hex_data); | 44 std::string a2b_hex(const char* hex_data); |
| 40 | 45 |
| 41 // Returns a SHA1 HashValue in which each byte has the value |label|. | 46 // Returns a SHA1 HashValue in which each byte has the value |label|. |
| 42 HashValue GetTestHashValue(uint8_t label); | 47 HashValue GetTestHashValue(uint8_t label); |
| 43 | 48 |
| 44 // Returns SHA1 pinning header for the of the base64 encoding of | 49 // Returns SHA1 pinning header for the of the base64 encoding of |
| 45 // GetTestHashValue(|label|). | 50 // GetTestHashValue(|label|). |
| 46 std::string GetTestPin(uint8_t label); | 51 std::string GetTestPin(uint8_t label); |
| 47 | 52 |
| 48 // Adds a pin for |host| to |state|. | 53 // Adds a pin for |host| to |state|. |
| 49 void AddPin(TransportSecurityState* state, | 54 void AddPin(TransportSecurityState* state, |
| 50 const std::string& host, | 55 const std::string& host, |
| 51 uint8_t primary_label, | 56 uint8_t primary_label, |
| 52 uint8_t backup_label); | 57 uint8_t backup_label); |
| 53 | 58 |
| 54 } // namespace test | 59 } // namespace test |
| 55 | |
| 56 } // namespace net | 60 } // namespace net |
| 57 | 61 |
| 58 #endif // NET_SPDY_TEST_UTILS_H_ | 62 #endif // NET_SPDY_TEST_UTILS_H_ |
| OLD | NEW |