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

Side by Side Diff: net/tools/quic/quic_server_session_base_test.cc

Issue 1979763002: Landing Recent QUIC changes until Sun May 8 00:39:29 2016 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « net/tools/quic/quic_packet_reader.cc ('k') | net/tools/quic/quic_simple_server_session_test.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/tools/quic/quic_server_session_base.h" 5 #include "net/tools/quic/quic_server_session_base.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 12 matching lines...) Expand all
23 #include "net/quic/test_tools/quic_spdy_stream_peer.h" 23 #include "net/quic/test_tools/quic_spdy_stream_peer.h"
24 #include "net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h" 24 #include "net/quic/test_tools/quic_sustained_bandwidth_recorder_peer.h"
25 #include "net/quic/test_tools/quic_test_utils.h" 25 #include "net/quic/test_tools/quic_test_utils.h"
26 #include "net/test/gtest_util.h" 26 #include "net/test/gtest_util.h"
27 #include "net/tools/quic/quic_simple_server_stream.h" 27 #include "net/tools/quic/quic_simple_server_stream.h"
28 #include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h" 28 #include "net/tools/quic/test_tools/mock_quic_server_session_visitor.h"
29 #include "testing/gmock/include/gmock/gmock.h" 29 #include "testing/gmock/include/gmock/gmock.h"
30 #include "testing/gtest/include/gtest/gtest.h" 30 #include "testing/gtest/include/gtest/gtest.h"
31 31
32 using net::test::CryptoTestUtils; 32 using net::test::CryptoTestUtils;
33 using net::test::MockConnection; 33 using net::test::MockQuicConnection;
34 using net::test::MockConnectionHelper; 34 using net::test::MockQuicConnectionHelper;
35 using net::test::QuicConfigPeer; 35 using net::test::QuicConfigPeer;
36 using net::test::QuicConnectionPeer; 36 using net::test::QuicConnectionPeer;
37 using net::test::QuicSpdyStreamPeer; 37 using net::test::QuicSpdyStreamPeer;
38 using net::test::QuicSentPacketManagerPeer; 38 using net::test::QuicSentPacketManagerPeer;
39 using net::test::QuicSessionPeer; 39 using net::test::QuicSessionPeer;
40 using net::test::QuicSpdySessionPeer; 40 using net::test::QuicSpdySessionPeer;
41 using net::test::QuicSustainedBandwidthRecorderPeer; 41 using net::test::QuicSustainedBandwidthRecorderPeer;
42 using net::test::SupportedVersions; 42 using net::test::SupportedVersions;
43 using net::test::ValueRestore; 43 using net::test::ValueRestore;
44 using net::test::kClientDataStreamId1; 44 using net::test::kClientDataStreamId1;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 CryptoTestUtils::ProofSourceForTesting()), 127 CryptoTestUtils::ProofSourceForTesting()),
128 compressed_certs_cache_( 128 compressed_certs_cache_(
129 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize) { 129 QuicCompressedCertsCache::kQuicCompressedCertsCacheSize) {
130 FLAGS_quic_always_log_bugs_for_tests = true; 130 FLAGS_quic_always_log_bugs_for_tests = true;
131 config_.SetMaxStreamsPerConnection(kMaxStreamsForTest, kMaxStreamsForTest); 131 config_.SetMaxStreamsPerConnection(kMaxStreamsForTest, kMaxStreamsForTest);
132 config_.SetInitialStreamFlowControlWindowToSend( 132 config_.SetInitialStreamFlowControlWindowToSend(
133 kInitialStreamFlowControlWindowForTest); 133 kInitialStreamFlowControlWindowForTest);
134 config_.SetInitialSessionFlowControlWindowToSend( 134 config_.SetInitialSessionFlowControlWindowToSend(
135 kInitialSessionFlowControlWindowForTest); 135 kInitialSessionFlowControlWindowForTest);
136 136
137 connection_ = new StrictMock<MockConnection>(&helper_, &alarm_factory_, 137 connection_ = new StrictMock<MockQuicConnection>(
138 Perspective::IS_SERVER, 138 &helper_, &alarm_factory_, Perspective::IS_SERVER,
139 SupportedVersions(GetParam())); 139 SupportedVersions(GetParam()));
140 session_.reset(new TestServerSession(config_, connection_, &owner_, 140 session_.reset(new TestServerSession(config_, connection_, &owner_,
141 &crypto_config_, 141 &crypto_config_,
142 &compressed_certs_cache_)); 142 &compressed_certs_cache_));
143 MockClock clock; 143 MockClock clock;
144 handshake_message_.reset(crypto_config_.AddDefaultConfig( 144 handshake_message_.reset(crypto_config_.AddDefaultConfig(
145 QuicRandom::GetInstance(), &clock, 145 QuicRandom::GetInstance(), &clock,
146 QuicCryptoServerConfig::ConfigOptions())); 146 QuicCryptoServerConfig::ConfigOptions()));
147 session_->Initialize(); 147 session_->Initialize();
148 visitor_ = QuicConnectionPeer::GetVisitor(connection_); 148 visitor_ = QuicConnectionPeer::GetVisitor(connection_);
149 } 149 }
150 150
151 StrictMock<MockQuicServerSessionVisitor> owner_; 151 StrictMock<MockQuicServerSessionVisitor> owner_;
152 MockConnectionHelper helper_; 152 MockQuicConnectionHelper helper_;
153 MockAlarmFactory alarm_factory_; 153 MockAlarmFactory alarm_factory_;
154 StrictMock<MockConnection>* connection_; 154 StrictMock<MockQuicConnection>* connection_;
155 QuicConfig config_; 155 QuicConfig config_;
156 QuicCryptoServerConfig crypto_config_; 156 QuicCryptoServerConfig crypto_config_;
157 QuicCompressedCertsCache compressed_certs_cache_; 157 QuicCompressedCertsCache compressed_certs_cache_;
158 std::unique_ptr<TestServerSession> session_; 158 std::unique_ptr<TestServerSession> session_;
159 std::unique_ptr<CryptoHandshakeMessage> handshake_message_; 159 std::unique_ptr<CryptoHandshakeMessage> handshake_message_;
160 QuicConnectionVisitorInterface* visitor_; 160 QuicConnectionVisitorInterface* visitor_;
161 }; 161 };
162 162
163 // Compares CachedNetworkParameters. 163 // Compares CachedNetworkParameters.
164 MATCHER_P(EqualsProto, network_params, "") { 164 MATCHER_P(EqualsProto, network_params, "") {
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 EXPECT_FALSE( 549 EXPECT_FALSE(
550 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); 550 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get()));
551 session_->OnConfigNegotiated(); 551 session_->OnConfigNegotiated();
552 EXPECT_FALSE( 552 EXPECT_FALSE(
553 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); 553 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get()));
554 } 554 }
555 555
556 } // namespace 556 } // namespace
557 } // namespace test 557 } // namespace test
558 } // namespace net 558 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_packet_reader.cc ('k') | net/tools/quic/quic_simple_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698