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

Unified Diff: net/tools/quic/quic_dispatcher_test.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_server_session_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher_test.cc
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
index d374906bb37d3fc4068ca0930b23c1a795fb5a6b..e4373085e92ab1dc80b65043a61ac721fcc26c19 100644
--- a/net/tools/quic/quic_dispatcher_test.cc
+++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -50,8 +50,13 @@ class TestQuicSpdyServerSession : public QuicServerSessionBase {
public:
TestQuicSpdyServerSession(const QuicConfig& config,
QuicConnection* connection,
- const QuicCryptoServerConfig* crypto_config)
- : QuicServerSessionBase(config, connection, nullptr, crypto_config),
+ const QuicCryptoServerConfig* crypto_config,
+ QuicCompressedCertsCache* compressed_certs_cache)
+ : QuicServerSessionBase(config,
+ connection,
+ nullptr,
+ crypto_config,
+ compressed_certs_cache),
crypto_stream_(QuicServerSessionBase::GetCryptoStream()) {}
~TestQuicSpdyServerSession() override{};
@@ -127,10 +132,12 @@ QuicServerSessionBase* CreateSession(
const IPEndPoint& client_address,
MockConnectionHelper* helper,
const QuicCryptoServerConfig* crypto_config,
+ QuicCompressedCertsCache* compressed_certs_cache,
TestQuicSpdyServerSession** session) {
MockServerConnection* connection =
new MockServerConnection(connection_id, helper, dispatcher);
- *session = new TestQuicSpdyServerSession(config, connection, crypto_config);
+ *session = new TestQuicSpdyServerSession(config, connection, crypto_config,
+ compressed_certs_cache);
connection->set_visitor(*session);
ON_CALL(*connection, SendConnectionCloseWithDetails(_, _))
.WillByDefault(WithoutArgs(Invoke(
@@ -256,17 +263,19 @@ TEST_F(QuicDispatcherTest, ProcessPackets) {
server_address_ = IPEndPoint(net::test::Any4(), 5);
EXPECT_CALL(dispatcher_, CreateQuicSession(1, client_address))
- .WillOnce(testing::Return(CreateSession(&dispatcher_, config_, 1,
- client_address, &mock_helper_,
- &crypto_config_, &session1_)));
+ .WillOnce(testing::Return(CreateSession(
+ &dispatcher_, config_, 1, client_address, &mock_helper_,
+ &crypto_config_, QuicDispatcherPeer::GetCache(&dispatcher_),
+ &session1_)));
ProcessPacket(client_address, 1, true, false, "foo");
EXPECT_EQ(client_address, dispatcher_.current_client_address());
EXPECT_EQ(server_address_, dispatcher_.current_server_address());
EXPECT_CALL(dispatcher_, CreateQuicSession(2, client_address))
- .WillOnce(testing::Return(CreateSession(&dispatcher_, config_, 2,
- client_address, &mock_helper_,
- &crypto_config_, &session2_)));
+ .WillOnce(testing::Return(CreateSession(
+ &dispatcher_, config_, 2, client_address, &mock_helper_,
+ &crypto_config_, QuicDispatcherPeer::GetCache(&dispatcher_),
+ &session2_)));
ProcessPacket(client_address, 2, true, false, "bar");
EXPECT_CALL(*reinterpret_cast<MockConnection*>(session1_->connection()),
@@ -294,9 +303,10 @@ TEST_F(QuicDispatcherTest, StatefulVersionNegotiation) {
server_address_ = IPEndPoint(net::test::Any4(), 5);
EXPECT_CALL(dispatcher_, CreateQuicSession(1, client_address))
- .WillOnce(testing::Return(CreateSession(&dispatcher_, config_, 1,
- client_address, &mock_helper_,
- &crypto_config_, &session1_)));
+ .WillOnce(testing::Return(CreateSession(
+ &dispatcher_, config_, 1, client_address, &mock_helper_,
+ &crypto_config_, QuicDispatcherPeer::GetCache(&dispatcher_),
+ &session1_)));
QuicVersion version = static_cast<QuicVersion>(QuicVersionMin() - 1);
ProcessPacket(client_address, 1, true, version, "foo",
PACKET_8BYTE_CONNECTION_ID, PACKET_6BYTE_PACKET_NUMBER, 1);
@@ -306,9 +316,10 @@ TEST_F(QuicDispatcherTest, Shutdown) {
IPEndPoint client_address(net::test::Loopback4(), 1);
EXPECT_CALL(dispatcher_, CreateQuicSession(_, client_address))
- .WillOnce(testing::Return(CreateSession(&dispatcher_, config_, 1,
- client_address, &mock_helper_,
- &crypto_config_, &session1_)));
+ .WillOnce(testing::Return(CreateSession(
+ &dispatcher_, config_, 1, client_address, &mock_helper_,
+ &crypto_config_, QuicDispatcherPeer::GetCache(&dispatcher_),
+ &session1_)));
ProcessPacket(client_address, 1, true, false, "foo");
@@ -325,9 +336,10 @@ TEST_F(QuicDispatcherTest, TimeWaitListManager) {
IPEndPoint client_address(net::test::Loopback4(), 1);
QuicConnectionId connection_id = 1;
EXPECT_CALL(dispatcher_, CreateQuicSession(connection_id, client_address))
- .WillOnce(testing::Return(
- CreateSession(&dispatcher_, config_, connection_id, client_address,
- &mock_helper_, &crypto_config_, &session1_)));
+ .WillOnce(testing::Return(CreateSession(
+ &dispatcher_, config_, connection_id, client_address, &mock_helper_,
+ &crypto_config_, QuicDispatcherPeer::GetCache(&dispatcher_),
+ &session1_)));
ProcessPacket(client_address, connection_id, true, false, "foo");
// Close the connection by sending public reset packet.
@@ -471,7 +483,8 @@ class QuicDispatcherStatelessRejectTest
QuicConnectionId connection_id,
const IPEndPoint& client_address) {
CreateSession(&dispatcher_, config_, connection_id, client_address,
- &mock_helper_, &crypto_config_, &session1_);
+ &mock_helper_, &crypto_config_,
+ QuicDispatcherPeer::GetCache(&dispatcher_), &session1_);
crypto_stream1_ = new MockQuicCryptoServerStream(crypto_config_, session1_);
session1_->SetCryptoStream(crypto_stream1_);
@@ -505,9 +518,10 @@ TEST_F(QuicDispatcherTest, OKSeqNoPacketProcessed) {
server_address_ = IPEndPoint(net::test::Any4(), 5);
EXPECT_CALL(dispatcher_, CreateQuicSession(1, client_address))
- .WillOnce(testing::Return(CreateSession(&dispatcher_, config_, 1,
- client_address, &mock_helper_,
- &crypto_config_, &session1_)));
+ .WillOnce(testing::Return(CreateSession(
+ &dispatcher_, config_, 1, client_address, &mock_helper_,
+ &crypto_config_, QuicDispatcherPeer::GetCache(&dispatcher_),
+ &session1_)));
// A packet whose packet number is the largest that is allowed to start a
// connection.
ProcessPacket(client_address, connection_id, true, false, "data",
@@ -653,15 +667,15 @@ class QuicDispatcherWriteBlockedListTest : public QuicDispatcherTest {
IPEndPoint client_address(net::test::Loopback4(), 1);
EXPECT_CALL(dispatcher_, CreateQuicSession(_, client_address))
- .WillOnce(testing::Return(CreateSession(&dispatcher_, config_, 1,
- client_address, &helper_,
- &crypto_config_, &session1_)));
+ .WillOnce(testing::Return(CreateSession(
+ &dispatcher_, config_, 1, client_address, &helper_, &crypto_config_,
+ QuicDispatcherPeer::GetCache(&dispatcher_), &session1_)));
ProcessPacket(client_address, 1, true, false, "foo");
EXPECT_CALL(dispatcher_, CreateQuicSession(_, client_address))
- .WillOnce(testing::Return(CreateSession(&dispatcher_, config_, 2,
- client_address, &helper_,
- &crypto_config_, &session2_)));
+ .WillOnce(testing::Return(CreateSession(
+ &dispatcher_, config_, 2, client_address, &helper_, &crypto_config_,
+ QuicDispatcherPeer::GetCache(&dispatcher_), &session2_)));
ProcessPacket(client_address, 2, true, false, "bar");
blocked_list_ = QuicDispatcherPeer::GetWriteBlockedList(&dispatcher_);
« no previous file with comments | « net/tools/quic/quic_dispatcher.cc ('k') | net/tools/quic/quic_server_session_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698