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

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

Issue 380543003: Add an async ChannelIDSource for testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address rch review comments. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_crypto_server_stream_test.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 cc16d4699b627fee761a420ba1ba3ff7acbc7668..bd9f8edbda7605b9e2e4082f9d843f6dfd3c9475 100644
--- a/net/quic/test_tools/crypto_test_utils.h
+++ b/net/quic/test_tools/crypto_test_utils.h
@@ -38,6 +38,17 @@ class PacketSavingConnection;
class CryptoTestUtils {
public:
+ // An interface for a source of work. Call the DoPendingWork method regularly
+ // to do the work from this source.
Ryan Hamilton 2014/07/09 22:55:49 Can you mentioned that this may be use for things
wtc 2014/07/09 23:21:48 Done.
+ class WorkSource {
+ public:
+ virtual ~WorkSource() {}
+
+ // Does pending work in this source. If there is no pending work, does
+ // nothing.
+ virtual void DoPendingWork() = 0;
+ };
+
// FakeClientOptions bundles together a number of options for configuring
// HandshakeWithFakeClient.
struct FakeClientOptions {
@@ -50,6 +61,10 @@ class CryptoTestUtils {
// If channel_id_enabled is true then the client will attempt to send a
// ChannelID.
bool channel_id_enabled;
+
+ // 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;
};
// returns: the number of client hellos that the client sent.
@@ -76,6 +91,17 @@ class CryptoTestUtils {
PacketSavingConnection* b_conn,
QuicCryptoStream* b);
+ // CommunicateHandshakeMessagesAndDoWork moves messages from |a| to |b| and
+ // back until |a|'s handshake has completed. If |work_source| is not NULL,
+ // CommunicateHandshakeMessagesAndDoWork also does work from |work_source|
+ // between processing messages.
+ static void CommunicateHandshakeMessagesAndDoWork(
+ PacketSavingConnection* a_conn,
+ QuicCryptoStream* a,
+ PacketSavingConnection* b_conn,
+ QuicCryptoStream* b,
+ WorkSource* work_source = NULL);
Ryan Hamilton 2014/07/09 22:55:49 I suspect that you meant to remove the = NULL here
wtc 2014/07/09 23:21:48 Done. Thank you for catching this!
+
// AdvanceHandshake attempts to moves messages from |a| to |b| and |b| to |a|.
// Returns the number of messages moved.
static std::pair<size_t, size_t> AdvanceHandshake(
« no previous file with comments | « net/quic/quic_crypto_server_stream_test.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