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

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

Issue 498373002: Refactor pooling logic into a helper method Disable pooling when there are cert errors. Disable poo… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: 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
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h>
9
8 #include <string> 10 #include <string>
9 11
10 #include "net/spdy/spdy_protocol.h" 12 #include "net/spdy/spdy_protocol.h"
11 13
12 namespace net { 14 namespace net {
13 15
16 class HashValue;
17 class TransportSecurityState;
18
14 namespace test { 19 namespace test {
15 20
16 std::string HexDumpWithMarks(const unsigned char* data, int length, 21 std::string HexDumpWithMarks(const unsigned char* data, int length,
17 const bool* marks, int mark_length); 22 const bool* marks, int mark_length);
18 23
19 void CompareCharArraysWithHexError( 24 void CompareCharArraysWithHexError(
20 const std::string& description, 25 const std::string& description,
21 const unsigned char* actual, 26 const unsigned char* actual,
22 const int actual_len, 27 const int actual_len,
23 const unsigned char* expected, 28 const unsigned char* expected,
24 const int expected_len); 29 const int expected_len);
25 30
26 void SetFrameFlags(SpdyFrame* frame, 31 void SetFrameFlags(SpdyFrame* frame,
27 uint8 flags, 32 uint8 flags,
28 SpdyMajorVersion spdy_version); 33 SpdyMajorVersion spdy_version);
29 34
30 void SetFrameLength(SpdyFrame* frame, 35 void SetFrameLength(SpdyFrame* frame,
31 size_t length, 36 size_t length,
32 SpdyMajorVersion spdy_version); 37 SpdyMajorVersion spdy_version);
33 38
34 std::string a2b_hex(const char* hex_data); 39 std::string a2b_hex(const char* hex_data);
35 40
41 // Returns a SHA1 HashValue in which each byte has the value |label|.
42 HashValue GetTestHashValue(uint8_t label);
43
44 // Returns SHA1 pinning header for the of the base64 encoding of
45 // GetTestHashValue(|label|).
46 std::string GetTestPin(uint8_t label);
47
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);
53
36 } // namespace test 54 } // namespace test
37 55
38 } // namespace net 56 } // namespace net
39 57
40 #endif // NET_SPDY_TEST_UTILS_H_ 58 #endif // NET_SPDY_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_unittest.cc ('k') | net/spdy/spdy_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698