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

Unified Diff: net/quic/test_tools/crypto_test_utils.h

Issue 1437023002: Landing Recent QUIC changes until 2015-11-09 20:32 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/crypto_test_utils.h
diff --git a/net/quic/test_tools/crypto_test_utils.h b/net/quic/test_tools/crypto_test_utils.h
index b881b45773ea59a79112fe6a3168677253f7b83f..b823c61fa99d60c6c1626608a1a67b0d8adb12bb 100644
--- a/net/quic/test_tools/crypto_test_utils.h
+++ b/net/quic/test_tools/crypto_test_utils.h
@@ -54,6 +54,16 @@ class CryptoTestUtils {
virtual void RunPendingCallbacks() = 0;
};
+ // FakeServerOptions bundles together a number of options for configuring the
+ // server in HandshakeWithFakeServer.
+ struct FakeServerOptions {
+ FakeServerOptions();
+
+ // If token_binding_enabled is true, then the server will attempt to
+ // negotiate Token Binding.
+ bool token_binding_enabled;
+ };
+
// FakeClientOptions bundles together a number of options for configuring
// HandshakeWithFakeClient.
struct FakeClientOptions {
@@ -66,12 +76,17 @@ class CryptoTestUtils {
// If channel_id_source_async is true then the client will use an async
// ChannelIDSource for testing. Ignored if channel_id_enabled is false.
bool channel_id_source_async;
+
+ // If token_binding_enabled is true, then the client will attempt to
+ // negotiate Token Binding.
+ bool token_binding_enabled;
};
// returns: the number of client hellos that the client sent.
static int HandshakeWithFakeServer(MockConnectionHelper* helper,
PacketSavingConnection* client_conn,
- QuicCryptoClientStream* client);
+ QuicCryptoClientStream* client,
+ const FakeServerOptions& options);
// returns: the number of client hellos that the client sent.
static int HandshakeWithFakeClient(MockConnectionHelper* helper,
@@ -86,7 +101,8 @@ class CryptoTestUtils {
const QuicClock* clock,
QuicRandom* rand,
QuicConfig* config,
- QuicCryptoServerConfig* crypto_config);
+ QuicCryptoServerConfig* crypto_config,
+ const FakeServerOptions& options);
// CommunicateHandshakeMessages moves messages from |a| to |b| and back until
// |a|'s handshake has completed.
@@ -165,6 +181,15 @@ class CryptoTestUtils {
// method never returns QUIC_PENDING.
static ChannelIDSource* ChannelIDSourceForTesting();
+ // MovePackets parses crypto handshake messages from packet number
+ // |*inout_packet_index| through to the last packet (or until a packet fails
+ // to decrypt) and has |dest_stream| process them. |*inout_packet_index| is
+ // updated with an index one greater than the last packet processed.
+ static void MovePackets(PacketSavingConnection* source_conn,
+ size_t* inout_packet_index,
+ QuicCryptoStream* dest_stream,
+ PacketSavingConnection* dest_conn);
+
private:
static void CompareClientAndServerKeys(QuicCryptoClientStream* client,
QuicCryptoServerStream* server);
« 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