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

Side by Side Diff: net/quic/test_tools/crypto_test_utils.h

Issue 15074007: Land Recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix for windows Created 7 years, 7 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
« no previous file with comments | « net/quic/reliable_quic_stream.cc ('k') | net/quic/test_tools/crypto_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_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ 5 #ifndef NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_
6 #define NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ 6 #define NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 14 matching lines...) Expand all
25 class QuicCryptoServerStream; 25 class QuicCryptoServerStream;
26 class QuicCryptoStream; 26 class QuicCryptoStream;
27 class QuicRandom; 27 class QuicRandom;
28 28
29 namespace test { 29 namespace test {
30 30
31 class PacketSavingConnection; 31 class PacketSavingConnection;
32 32
33 class CryptoTestUtils { 33 class CryptoTestUtils {
34 public: 34 public:
35 // FakeClientOptions bundles together a number of options for configuring
36 // HandshakeWithFakeClient.
37 struct FakeClientOptions {
38 FakeClientOptions();
39
40 // If dont_verify_certs is true then no ProofVerifier is set on the client.
41 // Thus no certificates will be requested or checked.
42 bool dont_verify_certs;
43 };
44
35 // returns: the number of client hellos that the client sent. 45 // returns: the number of client hellos that the client sent.
36 static int HandshakeWithFakeServer(PacketSavingConnection* client_conn, 46 static int HandshakeWithFakeServer(PacketSavingConnection* client_conn,
37 QuicCryptoClientStream* client); 47 QuicCryptoClientStream* client);
38 48
39 // returns: the number of client hellos that the client sent. 49 // returns: the number of client hellos that the client sent.
40 static int HandshakeWithFakeClient(PacketSavingConnection* server_conn, 50 static int HandshakeWithFakeClient(PacketSavingConnection* server_conn,
41 QuicCryptoServerStream* server); 51 QuicCryptoServerStream* server,
52 const FakeClientOptions& options);
42 53
43 // SetupCryptoServerConfigForTest configures |config| and |crypto_config| 54 // SetupCryptoServerConfigForTest configures |config| and |crypto_config|
44 // with sensible defaults for testing. 55 // with sensible defaults for testing.
45 static void SetupCryptoServerConfigForTest( 56 static void SetupCryptoServerConfigForTest(
46 const QuicClock* clock, 57 const QuicClock* clock,
47 QuicRandom* rand, 58 QuicRandom* rand,
48 QuicConfig* config, 59 QuicConfig* config,
49 QuicCryptoServerConfig* crypto_config); 60 QuicCryptoServerConfig* crypto_config);
50 61
51 // CommunicateHandshakeMessages moves messages from |a| to |b| and back until 62 // CommunicateHandshakeMessages moves messages from |a| to |b| and back until
(...skipping 22 matching lines...) Expand all
74 private: 85 private:
75 static void CompareClientAndServerKeys(QuicCryptoClientStream* client, 86 static void CompareClientAndServerKeys(QuicCryptoClientStream* client,
76 QuicCryptoServerStream* server); 87 QuicCryptoServerStream* server);
77 }; 88 };
78 89
79 } // namespace test 90 } // namespace test
80 91
81 } // namespace net 92 } // namespace net
82 93
83 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_ 94 #endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « net/quic/reliable_quic_stream.cc ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698