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

Side by Side Diff: net/quic/quic_stream_factory_test.cc

Issue 524463004: Adds plumbing for always requiring handshake confirmation in QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed. Created 6 years, 3 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_stream_factory.cc ('k') | no next file » | 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/quic_stream_factory.h" 5 #include "net/quic/quic_stream_factory.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "net/base/test_data_directory.h" 9 #include "net/base/test_data_directory.h"
10 #include "net/cert/cert_verifier.h" 10 #include "net/cert/cert_verifier.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 } 86 }
87 }; 87 };
88 88
89 class QuicStreamFactoryTest : public ::testing::TestWithParam<QuicVersion> { 89 class QuicStreamFactoryTest : public ::testing::TestWithParam<QuicVersion> {
90 protected: 90 protected:
91 QuicStreamFactoryTest() 91 QuicStreamFactoryTest()
92 : random_generator_(0), 92 : random_generator_(0),
93 clock_(new MockClock()), 93 clock_(new MockClock()),
94 maker_(GetParam(), 0, clock_), 94 maker_(GetParam(), 0, clock_),
95 cert_verifier_(CertVerifier::CreateDefault()), 95 cert_verifier_(CertVerifier::CreateDefault()),
96 channel_id_service_(new ChannelIDService( 96 channel_id_service_(
97 new DefaultChannelIDStore(NULL), 97 new ChannelIDService(new DefaultChannelIDStore(NULL),
98 base::MessageLoopProxy::current())), 98 base::MessageLoopProxy::current())),
99 factory_(&host_resolver_, &socket_factory_, 99 factory_(&host_resolver_,
100 base::WeakPtr<HttpServerProperties>(), cert_verifier_.get(), 100 &socket_factory_,
101 channel_id_service_.get(), &transport_security_state_, 101 base::WeakPtr<HttpServerProperties>(),
102 &crypto_client_stream_factory_, &random_generator_, clock_, 102 cert_verifier_.get(),
103 kDefaultMaxPacketSize, std::string(), 103 channel_id_service_.get(),
104 SupportedVersions(GetParam()), true, true, QuicTagVector()), 104 &transport_security_state_,
105 &crypto_client_stream_factory_,
106 &random_generator_,
107 clock_,
108 kDefaultMaxPacketSize,
109 std::string(),
110 SupportedVersions(GetParam()),
111 /*enable_port_selection=*/true,
112 /*enable_time_based_loss_detection=*/true,
113 /*always_require_handshake_confirmation=*/true,
114 QuicTagVector()),
105 host_port_pair_(kDefaultServerHostName, kDefaultServerPort), 115 host_port_pair_(kDefaultServerHostName, kDefaultServerPort),
106 is_https_(false), 116 is_https_(false),
107 privacy_mode_(PRIVACY_MODE_DISABLED) { 117 privacy_mode_(PRIVACY_MODE_DISABLED) {
108 factory_.set_require_confirmation(false); 118 factory_.set_require_confirmation(false);
109 clock_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); 119 clock_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
110 } 120 }
111 121
112 scoped_ptr<QuicHttpStream> CreateIfSessionExists( 122 scoped_ptr<QuicHttpStream> CreateIfSessionExists(
113 const HostPortPair& host_port_pair, 123 const HostPortPair& host_port_pair,
114 const BoundNetLog& net_log) { 124 const BoundNetLog& net_log) {
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 QuicCryptoClientConfig::CachedState* cached2 = 1301 QuicCryptoClientConfig::CachedState* cached2 =
1292 crypto_config->LookupOrCreate(server_id2); 1302 crypto_config->LookupOrCreate(server_id2);
1293 EXPECT_NE(cached1->source_address_token(), cached2->source_address_token()); 1303 EXPECT_NE(cached1->source_address_token(), cached2->source_address_token());
1294 EXPECT_TRUE(cached2->source_address_token().empty()); 1304 EXPECT_TRUE(cached2->source_address_token().empty());
1295 EXPECT_FALSE(cached2->proof_valid()); 1305 EXPECT_FALSE(cached2->proof_valid());
1296 } 1306 }
1297 } 1307 }
1298 1308
1299 } // namespace test 1309 } // namespace test
1300 } // namespace net 1310 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698