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> |
11 | 11 |
| 12 #include "net/spdy/spdy_header_block.h" |
12 #include "net/spdy/spdy_protocol.h" | 13 #include "net/spdy/spdy_protocol.h" |
13 | 14 |
14 namespace net { | 15 namespace net { |
15 | 16 |
16 class HashValue; | 17 class HashValue; |
17 class TransportSecurityState; | 18 class TransportSecurityState; |
18 | 19 |
| 20 inline bool operator==(StringPiece x, |
| 21 const SpdyHeaderBlock::StringPieceProxy& y) { |
| 22 return x == y.operator StringPiece(); |
| 23 } |
| 24 |
19 namespace test { | 25 namespace test { |
20 | 26 |
21 std::string HexDumpWithMarks(const unsigned char* data, int length, | 27 std::string HexDumpWithMarks(const unsigned char* data, int length, |
22 const bool* marks, int mark_length); | 28 const bool* marks, int mark_length); |
23 | 29 |
24 void CompareCharArraysWithHexError( | 30 void CompareCharArraysWithHexError( |
25 const std::string& description, | 31 const std::string& description, |
26 const unsigned char* actual, | 32 const unsigned char* actual, |
27 const int actual_len, | 33 const int actual_len, |
28 const unsigned char* expected, | 34 const unsigned char* expected, |
(...skipping 24 matching lines...) Expand all Loading... |
53 // Adds a pin for |host| to |state|. | 59 // Adds a pin for |host| to |state|. |
54 void AddPin(TransportSecurityState* state, | 60 void AddPin(TransportSecurityState* state, |
55 const std::string& host, | 61 const std::string& host, |
56 uint8_t primary_label, | 62 uint8_t primary_label, |
57 uint8_t backup_label); | 63 uint8_t backup_label); |
58 | 64 |
59 } // namespace test | 65 } // namespace test |
60 } // namespace net | 66 } // namespace net |
61 | 67 |
62 #endif // NET_SPDY_TEST_UTILS_H_ | 68 #endif // NET_SPDY_TEST_UTILS_H_ |
OLD | NEW |