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

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

Issue 1783783003: Add a QuicCompressedCertsCache instance to QuicDispatcher, plumbing to QuicServerSessionBase but no… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@116273065
Patch Set: Created 4 years, 9 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/quic/quic_crypto_server_stream_test.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('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 #include "net/quic/test_tools/crypto_test_utils.h" 5 #include "net/quic/test_tools/crypto_test_utils.h"
6 6
7 #include "net/quic/crypto/channel_id.h" 7 #include "net/quic/crypto/channel_id.h"
8 #include "net/quic/crypto/common_cert_set.h" 8 #include "net/quic/crypto/common_cert_set.h"
9 #include "net/quic/crypto/crypto_handshake.h" 9 #include "net/quic/crypto/crypto_handshake.h"
10 #include "net/quic/crypto/quic_crypto_server_config.h" 10 #include "net/quic/crypto/quic_crypto_server_config.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 PacketSavingConnection* client_conn, 129 PacketSavingConnection* client_conn,
130 QuicCryptoClientStream* client, 130 QuicCryptoClientStream* client,
131 const FakeServerOptions& options) { 131 const FakeServerOptions& options) {
132 PacketSavingConnection* server_conn = new PacketSavingConnection( 132 PacketSavingConnection* server_conn = new PacketSavingConnection(
133 helper, Perspective::IS_SERVER, client_conn->supported_versions()); 133 helper, Perspective::IS_SERVER, client_conn->supported_versions());
134 134
135 QuicConfig config = DefaultQuicConfig(); 135 QuicConfig config = DefaultQuicConfig();
136 QuicCryptoServerConfig crypto_config(QuicCryptoServerConfig::TESTING, 136 QuicCryptoServerConfig crypto_config(QuicCryptoServerConfig::TESTING,
137 QuicRandom::GetInstance(), 137 QuicRandom::GetInstance(),
138 ProofSourceForTesting()); 138 ProofSourceForTesting());
139 QuicCompressedCertsCache compressed_certs_cache(
140 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize);
139 SetupCryptoServerConfigForTest(server_conn->clock(), 141 SetupCryptoServerConfigForTest(server_conn->clock(),
140 server_conn->random_generator(), &config, 142 server_conn->random_generator(), &config,
141 &crypto_config, options); 143 &crypto_config, options);
142 144
143 TestQuicSpdyServerSession server_session(server_conn, config, &crypto_config); 145 TestQuicSpdyServerSession server_session(server_conn, config, &crypto_config,
146 &compressed_certs_cache);
144 147
145 // The client's handshake must have been started already. 148 // The client's handshake must have been started already.
146 CHECK_NE(0u, client_conn->encrypted_packets_.size()); 149 CHECK_NE(0u, client_conn->encrypted_packets_.size());
147 150
148 CommunicateHandshakeMessages(client_conn, client, server_conn, 151 CommunicateHandshakeMessages(client_conn, client, server_conn,
149 server_session.GetCryptoStream()); 152 server_session.GetCryptoStream());
150 CompareClientAndServerKeys(client, server_session.GetCryptoStream()); 153 CompareClientAndServerKeys(client, server_session.GetCryptoStream());
151 154
152 return client->num_sent_client_hellos(); 155 return client->num_sent_client_hellos();
153 } 156 }
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 642
640 ASSERT_EQ(0u, crypto_framer.InputBytesRemaining()); 643 ASSERT_EQ(0u, crypto_framer.InputBytesRemaining());
641 644
642 for (const CryptoHandshakeMessage& message : crypto_visitor.messages()) { 645 for (const CryptoHandshakeMessage& message : crypto_visitor.messages()) {
643 dest_stream->OnHandshakeMessage(message); 646 dest_stream->OnHandshakeMessage(message);
644 } 647 }
645 } 648 }
646 649
647 } // namespace test 650 } // namespace test
648 } // namespace net 651 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_server_stream_test.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698