Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: net/spdy/spdy_test_utils.h

Issue 425803014: Refactor pooling logic into a helper method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add QUIC test Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <string> 8 #include <string>
9 9
10 #include "net/base/hash_value.h"
Ryan Sleevi 2014/08/11 18:45:17 Can forward declare this. See http://www.chromium
Ryan Hamilton 2014/08/12 14:39:06 Whoa! You forward declare if it's used as a return
Ryan Sleevi 2014/08/12 14:52:03 Yup. That's exactly it - you don't need to know th
11 #include "net/http/transport_security_state.h"
Ryan Sleevi 2014/08/11 18:45:17 Can forward declare this - only used as a pointer.
Ryan Hamilton 2014/08/12 14:39:06 Done.
10 #include "net/spdy/spdy_protocol.h" 12 #include "net/spdy/spdy_protocol.h"
11 13
12 namespace net { 14 namespace net {
13 15
14 namespace test { 16 namespace test {
15 17
16 std::string HexDumpWithMarks(const unsigned char* data, int length, 18 std::string HexDumpWithMarks(const unsigned char* data, int length,
17 const bool* marks, int mark_length); 19 const bool* marks, int mark_length);
18 20
19 void CompareCharArraysWithHexError( 21 void CompareCharArraysWithHexError(
20 const std::string& description, 22 const std::string& description,
21 const unsigned char* actual, 23 const unsigned char* actual,
22 const int actual_len, 24 const int actual_len,
23 const unsigned char* expected, 25 const unsigned char* expected,
24 const int expected_len); 26 const int expected_len);
25 27
26 void SetFrameFlags(SpdyFrame* frame, 28 void SetFrameFlags(SpdyFrame* frame,
27 uint8 flags, 29 uint8 flags,
28 SpdyMajorVersion spdy_version); 30 SpdyMajorVersion spdy_version);
29 31
30 void SetFrameLength(SpdyFrame* frame, 32 void SetFrameLength(SpdyFrame* frame,
31 size_t length, 33 size_t length,
32 SpdyMajorVersion spdy_version); 34 SpdyMajorVersion spdy_version);
33 35
34 std::string a2b_hex(const char* hex_data); 36 std::string a2b_hex(const char* hex_data);
35 37
38 // Returns a SHA1 HashValue in which each byte has the value |label|.
39 HashValue GetTestHashValue(uint8 label);
Ryan Sleevi 2014/08/11 18:45:17 1) These should be using uint8_t, not uint8, in SP
Ryan Hamilton 2014/08/12 14:39:06 I'm not sure I follow? We use basictypes all the t
Ryan Sleevi 2014/08/12 14:52:03 Basictypes is deprecated in Chrome. It existed bec
Ryan Hamilton 2014/08/12 15:37:10 *sigh* I "love" it that we deprecate stuff but don
40
41 // Returns SHA1 pinning header for the of the base64 encoding of
42 // GetTestHashValue(|label|).
43 std::string GetTestPin(uint8 label);
44
45 // Adds a pin for |host| to |state|.
46 void AddPin(TransportSecurityState* state,
47 const std::string& host,
48 uint8 primary_label,
49 uint8 backup_label);
50
36 } // namespace test 51 } // namespace test
37 52
38 } // namespace net 53 } // namespace net
39 54
40 #endif // NET_SPDY_TEST_UTILS_H_ 55 #endif // NET_SPDY_TEST_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698